🤔Ever wondered how databases maintain true serializability without killing performance?
This video breaks down Serializable Snapshot Isolation like never before - clear, practical, and rooted in real-world trade-offs!! 👇
https://t.co/fbF0wQ5kHi
In interviews, separate four questions: who orders writes, what is persisted, when is a write acknowledged, and how is a failed leader fenced? Those answers define consistency, durability, latency, and recovery behavior. #SystemDesign
Thread: A primary database dies during a traffic spike. Writes stop, replicas disagree on what they have, and clients may read stale data. Leader-based replication makes write ordering explicit, but its guarantees depend on the log, acknowledgements, and failover protocol.
Replication does not remove a leader bottleneck. One write stream, lock contention, index maintenance, and cross-region acknowledgement can limit throughput. Sharding distributes leaders, but adds routing, rebalancing, and cross-shard transaction complexity.
In interviews, state the key, distribution, query routing, resharding plan, and consistency model. Prefer local transactions and bounded fan-out. Partitioning improves scale only when workload, storage layout, and operational recovery are designed together. #SystemDesign
Thread: A feed works in a test with one database. Then traffic grows, one tenant becomes enormous, and a single lock, buffer pool, or disk queue becomes the bottleneck. Partitioning is how you split that pressure, but the partition key determines almost everything.
Skew is the classic failure mode: one celebrity, tenant, or time range overloads a shard. Salting spreads hot keys but makes reads fan out and complicates ordering. Cross-shard transactions and joins require coordination, often 2PC or application workflows.
Thread: A query can scan millions of rows yet return the first result quickly, then stall on a sort or hash join. The Volcano iterator model explains why: operators pull data from one another, and some operators cannot produce output until they consume all input.
Use Volcano for modular row-oriented execution, early termination, and clear operator composition. Prefer vectorized or compiled execution for CPU-heavy analytics. In interviews, explain both the elegant pull contract and its costs: blocking, spills, rescans, and per-row