FjellSystem Design Lab
Chapter 4 checkpoint

Chapter 4 checkpoint: scaling relational databases

Every question from this chapter’s lessons. Your first answer to each is the one that counts; afterward you can practice again as often as you like. Passing needs 75% right on the first attempt.

0 of 19 answered0 right on the first attempt
Question 1 of 19
A user changes their billing address and immediately reloads their account page, which reads from one of four asynchronous replicas, and sees the old address. Which change fixes this for that user without giving up the replicas?

Question 2 of 19
Match each replication mode to what a commit waits for.

Question 3 of 19
A user sees a new comment, refreshes, and the comment has disappeared; a moment later it is back. Reads go to whichever replica the load balancer picks. What is happening, and what fixes it?

Question 4 of 19
An old leader pauses for a minute, a new leader is elected, and then the old one wakes up and tries to write. What does a fencing token do?

Question 5 of 19
What does federation split a database by?

Question 6 of 19
An order page used to run one SQL join across orders, users and products. After federating into separate Orders, Users and Catalog databases, how does it usually get the same data?

Question 7 of 19
After federating, the Orders database still receives most of the traffic and is reaching its limits. What does that tell you?

Question 8 of 19
Which guarantee does a single database give that federated databases lose?

Question 9 of 19
One database primary handles 2,500 writes per second. A ledger must sustain 20,000 writes per second at peak, and you provision 25% more capacity than the peak. With writes spread evenly, how many shards does it need?
shards

Answers within 1% count.

Question 10 of 19
Keys are placed with hash(k) mod N\text{hash}(k) \bmod N. Going from 4 shards to 5, about what percentage of keys must move?
%

Answers within 3% count.

Question 11 of 19
With consistent hashing and virtual nodes, about what percentage of keys move when a fifth shard joins four?
%

Answers within 5% count.

Question 12 of 19
A multi-tenant SaaS has 50,000 customer accounts, and almost every query is about one account. Which shard key fits best?

Question 13 of 19
A query without the shard key fans out to 20 shards, and each is independently slow 1% of the time. About what percentage of these queries are slow?
%

Answers within 5% count.

Question 14 of 19
Why do high-throughput services often prefer sagas to two-phase commit for transactions across shards?

Question 15 of 19
A table has a composite index on (tenant_id, status, created_at). Which condition cannot use the index to narrow the scan?

Question 16 of 19
A query filters tenant_id = 42 AND status = 'POSTED' AND created_at > '2026-11-01'. Which index lets all three conditions narrow the scan?

Question 17 of 19
After scaling out to many application servers, each opening its own PostgreSQL connections, the database spends most of its memory and CPU on connections rather than queries. What helps most?

Question 18 of 19
What does denormalization trade?

Question 19 of 19
A database takes 10,000 queries a second, 20% of them writes. Writes go to the primary; reads are spread evenly over two read replicas. Each database server can do 5,000 operations a second, and replaying a write costs a replica as much as the write cost the primary. Which saturates first?