Design Patterns Flashcards

(10 cards)

1
Q

What is the Circuit Breaker pattern?

A

Circuit Breaker prevents cascading failures by monitoring for failures and temporarily blocking requests to failing services. States: Closed (normal), Open (failing), Half-Open (testing recovery).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Retry pattern?

A

Retry pattern automatically retries failed operations. Should use exponential backoff (increasing delays) and jitter (randomization) to avoid overwhelming systems. Set max retry limits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Bulkhead pattern?

A

Bulkhead isolates resources into pools so failure in one area doesn’t affect others. Like ship compartments, it prevents total system failure. Example: separate thread pools per service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Saga pattern?

A

Saga manages distributed transactions across microservices using a sequence of local transactions. Each step has a compensating transaction for rollback. Coordination: choreography or orchestration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is CQRS (Command Query Responsibility Segregation)?

A

CQRS separates read and write operations into different models. Write model optimized for updates, read model optimized for queries. Allows independent scaling and optimization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Event Sourcing?

A

Event Sourcing stores all changes as a sequence of events rather than current state. The state is reconstructed by replaying events. Provides audit trail and time travel capabilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Strangler Fig pattern?

A

Strangler Fig gradually replaces a legacy system by incrementally building new features around it. Old functionality is slowly retired as new system takes over. Reduces migration risk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Sidecar pattern?

A

Sidecar deploys helper components alongside main application in separate containers. Handles cross-cutting concerns like logging, monitoring, networking. Used in service mesh architectures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Ambassador pattern?

A

Ambassador pattern places a proxy container alongside application to handle network-related tasks like retry logic, monitoring, logging. Offloads complexity from main application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the Backend for Frontend (BFF) pattern?

A

BFF creates separate backend services tailored for each frontend (web, mobile, IoT). Each BFF optimizes API for its specific client needs. Prevents bloated one-size-fits-all APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly