Spring
10 posts
Sagas and the Outbox Pattern: Keeping a Cross-Service Flow Consistent Without Distributed Transactions
System Design series Part 7-3: sagas instead of distributed transactions, choreography vs orchestration, compensation, pivot steps, isolation anomalies, timeouts, outbox.
Circuit Breakers and Bulkheads: Keep One Broken Downstream from Taking Down the Whole System
System Design series Part 6-3: circuit breakers fail fast and fall back when a downstream fails, bulkheads stop cascading failures, in Resilience4j and @ConcurrencyLimit.
Idempotency and Idempotency Keys: Making Retries Safe
System Design series Part 5-4: retries that double sign-ups and charges; unique keys, conditional updates, Idempotency-Key; concurrency, fingerprints, expiry, key scope.
Rate Limiting: Algorithms, Distributed Rate Limiting, and How It Differs from Load Shedding
System Design series Part 6-4: fixed window, sliding window, and token bucket compared, distributed limits, keys and 429s, versus load shedding, and a Redis Lua script.
Real-Time Updates: Choosing Between Polling, Long Polling, SSE, and WebSocket, and Pushing from Many Servers
System Design series Part 5-5: polling, long polling, SSE, WebSocket compared; multi-server fan-out, conflation, reconnect gaps, Origin checks, per-message authorization.
Replication and Replication Lag: Why Users Cannot Read What They Just Wrote After Read/Write Splitting
System Design series Part 4-1: simulating four read routings under lag spikes, Spring read/write splitting, read-your-writes with GTIDs, and stale permission checks.
REST, gRPC, and GraphQL: Choosing an API Style by Caller
System Design series Part 5-1: compare REST, gRPC, and GraphQL on contracts, caching, streaming, and debugging; pick by caller; handle deadlines, N+1, and query depth.
Sharding: Choosing a Shard Key, Moving Data When You Reshard, and What You Lose Across Shards
System Design series Part 4-2: shard key skew, resharding cost, and fan-out latency simulated; sign-ups sharded by talk in Spring with an outbox index; tenant isolation.
Timeouts, Retries, Backoff, and Jitter: How Retries Save a System, and How They Bring It Down
System Design series Part 6-2: timeouts and timeout budgets, which errors to retry, backoff, jitter, and retry budgets against retry storms, with Spring 7 @Retryable.
Transactions and Isolation Levels: MVCC, Lost Updates, Write Skew, and Spring Transaction Boundaries
System Design series Part 3-4: lost update and write skew in sign-ups; conditional UPDATE, locks, unique constraints; isolation levels by database; Spring transactions.