Messaging and Correctness
Logs, queues, outboxes and sagas. How to move data between services without losing it or doing it twice.
Kafka, Explained With Sliders
How partitions, consumer groups, offsets and replication really behave under load. Sized for salary-day UPI traffic with zero magic numbers.
Kafka Hands-on Lab
Bring up a three-broker Kafka cluster on your laptop and break it on purpose. Keys, consumer groups, offset resets, retention, killing a leader, and a write that a healthy broker refuses.
Transactional Outbox
Saving to your database and telling the broker are two separate writes, and one of them will eventually fail alone. The outbox turns "tell the broker" into a row that commits with your data, so the event can be late but never lost.
Distributed Transactions and Sagas
One business action, three databases, and no single COMMIT that covers them. This page shows how two-phase commit and sagas each handle that, what each one breaks, and how to pick.
Optimistic vs Pessimistic Locking
Two requests read the same row, both decide it is safe, both write. Row locks make the second one wait. Version checks make the second one fail and retry. Which one you pick depends on how often people collide and how long you hold the lock.
Idempotency in Practice
The network will lose responses, clients will retry, brokers will redeliver. Idempotency is how you make sure the second attempt does not charge, book or send a second time. Keys, Postgres, Redis, consumers and webhooks, with the failure cases.
Design Live Comments (Hotstar / JioCinema Match Chat)
Two crore people are watching an IPL final and the chat panel is open on every phone. You cannot show every comment to every viewer, and you should not try. The design is about choosing what to drop, how to push the rest, and how to replay it later against the video timeline.
Chat Message Flow, Step by Step
One Diwali wish, a family group, and one cousin stuck in a train tunnel. Walk through send, persist, publish and deliver, and see which step saves you when the network misbehaves.