Search
Lessons (33)
- Timeouts, Retries & Backpressure
A slow dependency should consume a bounded budget, not create an infinite retry storm. The big idea A …
- Resilience Patterns
… wait time before each retry" x-axis ["retry 1", "retry 2", "retry 3", "retry 4", "retry 5"] y …
- Exactly-Once Payment Processing
Safe payment retries need a durable idempotency record, atomic state transition and provider-side deduplication. The invariant For …
- Kafka Producers
… batching, compression, partitioning, the acks setting that trades speed for safety, retries, and the idempotent producer. The big …
- Design a Reliable Notification System
… Watch oldest-job age, provider errors, retry rate, opt-out enforcement and tenant backlog.
- Consumers & Consumer Groups
… retries and dead-letter topics What if a message can't be processed (bad data, a downstream API …
- Message Queues & RabbitMQ
… Learn producers, consumers, acknowledgements, exchanges, retries and dead-letter queues with RabbitMQ. The big idea At a busy …
- The L6 System-Design Thinking Loop
… Walk one crash, timeout, or retry. 5. Explain metrics, mitigation, and the durable fix. 💡 A good trade-off …
- REST API Design
… Idempotency for unsafe retries ⭐ Networks fail. A client sends POST /payments , the connection drops, and the client doesn …
- Creational Patterns: How to Make Objects
… 10 000, retries: 0 }; url(url) { this. config.url = url; return this; } method(method) { this. config.method = method …
- Delivery Guarantees: At-Most, At-Least & Exactly Once
… producer ID + sequence numbers let the broker drop retried duplicates. It's on by default in modern Kafka …
- API Gateway, BFF & Service Discovery
… networking as infrastructure As services multiply, every one needs retries, timeouts, mutual TLS, metrics and tracing. Instead of …
- Scaling, Load Balancing & Rate Limiting
… Over the limit → 429 Too Many Requests with a Retry-After header. Token bucket (most popular) 🪣 A …
- Meaningful Names
… users , orderItems userList2 , arr Constant UPPER SNAKE MAX RETRIES , TAX RATE n , x mermaid flowchart LR Q{What …
- Database Indexing & Transactions
… 3; -- 0 rows → someone else won, reload and retry Pessimistic ( FOR UPDATE ) Optimistic ( version ) --- --- --- Idea "Lock it, then …
- Design a Chat Application
… A client idempotency key makes reconnect/retry safe. Order messages by conversation key, not globally. Presence is temporary …
- Design a Ride-Sharing Service
… Match nearby candidates, then atomically lease one driver; release/retry on rejection or timeout. Locations are eventually consistent …
- Real-Time, Pub/Sub, Webhooks and CDC
… with event ID Webhook Notify another server Sign, retry and make receiver idempotent WebRTC Direct low-latency media …
- Debug Latency Like an Investigator
… Only p99 rises Queueing, locks, GC, pool wait, retries, slow subset. Every morning Batch reports, backup, cache expiry …
- Transactions, Indexes & Concurrency
… Livelock means actors keep retrying/changing but make no useful progress. Use consistent lock order, short transactions and …
- Comments & Formatting
… const PAYMENT MAX RETRIES = 3; That second comment is gold: no amount of good naming could tell you …
- ACID, Transactions & Locks
… wait in a cycle; databases normally abort one. Retry only the aborted transaction with bounded backoff and idempotency …
- Serverless Architecture
… Event sources retry; the same event may arrive twice Push work to queues Smooth spikes, retry failures, add …
- Which Pattern Do I Need?
… wrapping 3rd-party libraries 3. ☕ Decorator — middleware, HOCs, retry/cache/log wrappers 4. 🏨 Facade — service layers and SDKs …
- Small Functions That Do One Thing
… false, retries: 3 }); ⚠️ Boolean flag arguments are a smell. render(true) usually means the function does two things …
- Clean Error Handling
… error where you can do something about it : retry, use a fallback, or show a message. Everywhere else …
- Monolith vs Microservices
… call that becomes a network call needs timeouts, retries, idempotency, authentication, monitoring and versioning. The middle path: the …
- Deployments, ReplicaSets & Rollouts
… migrations, batch processing Retries until it succeeds CronJob Scheduled jobs: nightly reports, cleanups Creates Jobs on a cron …
- State Management (Redux, Zustand, TanStack Query)
… loading and error states, caching, background refetching, deduplication, retries and invalidation after mutations. Don't hand-roll that …
- Service Communication: Sync vs Async
… timeout = one slow service can exhaust every thread. - 🔁 Retry with backoff , but only idempotent operations. - ⚡ Circuit breakers to …
- Deploying & Operating Microservices
… have: - [ ] Health endpoints ( /health/live , /health/ready ) - [ ] Timeouts, retries with backoff, and circuit breakers on outgoing calls - [ ] Graceful …
- Observability: Logs, Metrics & Traces
… events (order placed) ✅ warn Something odd but handled (retrying) ✅ error A request failed ✅ + alert on spikes fatal The …
- React Hooks in Practice
… They handle caching, deduplication, retries and race conditions for you. You might not need an effect Effects are …