
System Design Drill Day 9: Idempotency Keys for Payments and Retries
Why retries make duplicates inevitable, and how idempotency keys stop double charges and double stock decrements.
Csharpcorner MVP |Software Engineer|IOT| Azure|microbit| Web Developer | Udacity Scholar

Why retries make duplicates inevitable, and how idempotency keys stop double charges and double stock decrements.
How distributed locks work with Redis SET NX EX, why leases and fencing tokens matter, and where locks fit in a checkout.

The main rate-limiting algorithms, how to run them atomically across servers with Redis and Lua, and when to fail open or closed.

How to split a MySQL orders table across shards: choosing a shard key, routing with logical shards, keeping reports off the shards and resharding.

How to go from one Laravel server to three behind a load balancer: algorithms, health checks, stateless servers and safe deploys.

How MySQL read replicas scale reads, why replication lag breaks read-your-writes, and how to handle it in Laravel.

Why slow work belongs on a queue, what at-least-once delivery means, and how retries and idempotency keep background jobs safe.

How cache-aside caching with Redis works, how to choose TTLs, and how to stop a cache stampede from taking down your database.

What latency, throughput and availability really mean, and how to build a health-check endpoint that reports them honestly.
