Section 9: The Gauntlet - Interviewer Deep-Dive Challenges
Executive Summary: Sections 7 and 8 built search and the operation flip. Now the interviewer pushes, seven times. Each push gets what's really being tested, a model answer with numbers, the rejected alternative and what would flip it, and a line worth saying out loud.
Every answer lands on a mechanism you already drew:
Challenge One: "Why Not Postgres With JSONB and a Range Index?"
What they're really asking: do you pick stores by numbers, and do you know when the simpler one wins?
Agree first. JSONB, a GiST index on int8range(start_ms, end_ms) and a real transaction for the flip: under about 1 TB and 5,000 writes/s, I'd ship that.
Section 3 puts us well past it: 16 TB logical in three years and bulk peaks of 50,000 annotations/s, which is 300,000 replica writes/s. One primary won't take it, so we'd shard by hand: a routing layer, resharding, flips across shards. That's a worse Cassandra. Netflix has described the same shape for Marken: Cassandra as the source of truth, with the cluster growing from 12 to 24 nodes.
Interviewer: "You give up transactions."
You: "The only multi-row atomicity we need is the pointer flip; single-row compare-and-sets cover it and the edit check. Joins happen in Section 7's sweep-line, not in the store." On AWS without Cassandra operators, DynamoDB with the same keys is an equal answer.
The senior line: "Postgres wins below a terabyte. At 16 TB and 50,000 writes a second, the choice is Cassandra or hand-sharded Postgres, and I'd rather not build a database."
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson