Distributed Transactions & Resilience
4 Topics
1
The Problem with Distributed Transactions — Why 2PC Fails
Analyzing performance blocks and failure modes of Two-Phase Commit protocols.
Distributed system trade-offs. Expect questions on ACID vs BASE properties, CAP theorem constraints, the execution steps of 2PC, and why XA transactions degrade performance.
2
The Saga Pattern in Spring Boot — Choreography and Orchestration
Implementing step events channels or central state orchestrators with rollback compensations.
Saga pattern implementation details. Expect questions comparing Choreography vs Orchestration, writing compensating transactions, managing out-of-order events, and enforcing idempotency.
3
Resilience4j — Circuit Breaker, Retry, and Bulkhead
Decorating methods to degrade gracefully, retry failed requests, and isolate thread pools.
Fault tolerance architectures. Expect questions on circuit breaker states, sliding window configurations, bulkhead thread isolation, and writing robust fallback methods.
4
The Outbox Pattern — Guaranteed Event Publishing Without 2PC
Saving entities and events locally in a single database transaction, with separate poll publishes.
Transactional messaging patterns. Expect questions on dual-write issues, Outbox table design, Change Data Capture (CDC) integrations, and ensuring at-least-once delivery.