Learning Objectives & Key Takeaways
0 / 4 Completed- Understand System Design core architecture and runtime execution model
- Audit real-world latency, throughput benchmarks, and memory footprint
- Implement zero-downtime deployment patterns with resilience guards
- Verify code snippets and architect blueprints against production SLOs
- A dual write to the database and Kafka in two separate steps can silently create duplicate or lost orders.
- The outbox pattern writes the business row and the event row in one database transaction to close that gap.
- Kafka producer idempotence plus transactional.id prevents retries from creating duplicate records in the log.
- Consumers must still be idempotent because the outbox publisher only guarantees at-least-once delivery.
- isolation.level=read_committed is required for consumers to get true end-to-end transactional visibility.
3 AM: The Order That Paid Twice
The on-call engineer at a mid-size e-commerce company got paged because a customer complained their card was charged twice for a single order. The order service had written the order row to Postgres, then made a separate call to publish an OrderPlaced event to Kafka. The database write succeeded, but the Kafka publish call timed out on the network, so the service retried the entire handler, which inserted the order again under a new ID and fired a second event to the payment service.
This is the dual-write problem in its purest form. Any time a service writes to two independent systems, a database and a broker, there is a window between the two writes where a crash, timeout, or restart leaves them inconsistent. No amount of retry logic on the API handler fixes this, because the retry itself cannot tell whether the first write succeeded.
- The Transactional Outbox: One Commit, Two Rows
- Publishing With a Transactional Kafka Producer
- Configuring Brokers and Consumers for Real Transactions
- Why the Consumer Still Needs Its Own Idempotency
Checking your membership…
Members read every Tech Buzz story in full, with code examples, audio and the discussion, plus every course, quiz and interview set in the Learning Dashboard.



