Messaging Patterns
The Circuit Breaker Pattern
Stop cascading failures by detecting when a downstream service is unhealthy and short-circuiting calls until it recovers.
A circuit breaker wraps a remote call and tracks failure rates. In the Closed state, calls pass through normally. After a failure threshold is crossed, the breaker trips to Open and immediately rejects calls (fail fast). After a timeout, it enters Half-Open and allows a probe request: success resets to Closed, failure returns to Open.
Continue reading
- →
Dependency Injection and IoC Containers
Invert control of dependency creation to keep classes decoupled from their collaborators and trivially testable.
- →
The Observer Pattern and Event-Driven Design
Decouple publishers from subscribers by letting objects register interest in events without the producer knowing who is listening.
- →
The Strategy Pattern: Encapsulating Algorithms
Define a family of algorithms, encapsulate each one, and make them interchangeable — open for extension, closed for modification.