What:
Core architectural patterns designed to decouple monolithic databases and applications into independent, resilient microservices.
Primary purpose:
Enabling incremental code migrations, maintaining atomic multi-service transactions, and guaranteeing reliable system integration streams.
Usually used for:
Monolith-to-microservices migrations, distributed e-commerce transactions, and outbox event streams.
How should I think about this inside system architectures?
🌿 The Strangler Fig
Never execute a 'big bang' rewrite. Wrap the old monolith in an API gateway proxy, gradually strangling old features as new microservices replace them.
⚖️ Sagas & Compensations
Avoid locking distributed transactions. Run local updates instantly. On failure, fire undo actions in reverse chronological order.
📬 Atomic Outbox Delivery
Avoid dual-write failures. Write database state updates and outbox events in a single SQL transaction, using CDC relays to publish events to Kafka.