Tag

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.

System Design System Design · Saga · 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.

System Design System Design · Circuit Breaker · Bulkhead

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.

System Design System Design · Idempotency · REST

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.

System Design System Design · Rate Limiting · Token Bucket

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.

System Design System Design · SSE · WebSocket

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.

System Design System Design · Replication · MySQL

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.

System Design System Design · REST · gRPC

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.

System Design System Design · Sharding · Partitioning

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.

System Design System Design · Timeout · Retry

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.

System Design System Design · Transaction · Isolation Level