CSE Roadmap

Core tier · about 2 hours · 5 parts

Part 5 of 5 · 4 min read

Exercises

Easy

Easy 1: Name where writes must go (15 minutes)

State which node a write must be directed to in single-leader replication.

Done when: the leader, specifically, is correctly named.

Hint

The leader.

Easy 2: Name where reads can go (15 minutes)

State which nodes a read can safely be served from.

Done when: the leader or any follower is correctly named.

Hint

The leader or any follower.

Easy 3: Name the per-follower configuration choice (15 minutes)

Name the two configuration options a follower can be set to, regarding how it relates to the leader's commits.

Done when: synchronous and asynchronous are both correctly named.

Hint

Synchronous and asynchronous.

Medium

Medium 1: Decide whether a specific statement can go to a follower (25 minutes)

Determine whether SELECT COUNT(*) FROM orders; can be safely directed to a follower, and whether DELETE FROM orders WHERE order_id = 501; can be.

Done when: the SELECT is correctly identified as safe to direct to a follower, while the DELETE is correctly identified as needing to go to the leader specifically.

Hint

The SELECT is safe on a follower; the DELETE must go to the leader specifically, since it is a write.

Medium 2: Explain why allowing writes on any follower would be unsafe (25 minutes)

Explain why allowing a write to be accepted directly on any follower, rather than only the leader, could cause a correctness problem.

Done when: the explanation correctly notes two different followers could each independently accept a conflicting change to the same data at the same time, with no single authority deciding which change is actually correct.

Hint

Two different followers could each accept a conflicting write to the same data independently, with no single authority to resolve which change should actually win.

Medium 3: Decide a mixed synchronous and asynchronous configuration (30 minutes)

A leader has one follower in the same data center, used specifically for failover, and four followers in other regions, used purely to serve nearby reads faster. Decide a reasonable synchronous versus asynchronous configuration for these five followers.

Done when: the same-data-center failover follower is reasonably set to synchronous, for strong durability on failover, while the four regional read-scaling followers are reasonably set to asynchronous, avoiding added commit latency for a purpose that does not require it.

Hint

The same-data-center follower used for failover is reasonably set synchronous, for a strong durability guarantee; the four regional read-scaling followers are reasonably set asynchronous, since they do not need to add commit latency for their purpose.

Hard

Hard 1: Connect single-leader replication to Level 8's standby (30 minutes)

Explain precisely how single-leader replication with one follower is identical to the standby system covered in Level 8, and what specifically changes once a second follower is added.

Done when: the explanation correctly notes that with exactly one follower, single-leader replication is exactly Level 8's primary-and-standby setup; adding a second follower simply means the same log stream is sent to, and replayed by, more than one follower at once, with no other change to the underlying mechanism.

Hint

With exactly one follower, this is identical to Level 8's primary-and-standby setup; adding a second follower just means the same leader's log stream is sent to and replayed by more than one follower, with the underlying mechanism otherwise unchanged.

Hard 2: Diagnose a correctness bug from writes bypassing the leader (35 minutes)

A misconfigured application occasionally sends a write directly to a follower instead of the leader. Explain what kind of problem this could eventually cause.

Done when: the explanation correctly notes this follower's data could diverge from the leader and the other followers, since its own direct write was never part of the leader's single, authoritative stream of changes, eventually causing that follower to disagree with the rest of the system about the true state of the data.

Hint

That follower's data could start diverging from the leader and the other followers, since its own directly accepted write was never part of the leader's single authoritative stream, eventually causing it to disagree with the rest of the system about the true state of the data.

Hard 3: Design a replication configuration for a stated business requirement (40 minutes)

A business requires that a failover never lose a committed transaction, but also wants to scale out read traffic across many regions without slowing down writes more than strictly necessary. Propose a configuration using what this page covers.

Done when: a reasonable configuration is proposed, such as exactly one synchronous follower dedicated to failover, satisfying the no-lost-commits requirement, combined with any number of additional asynchronous followers spread across regions purely for read scaling, since those followers do not need to add latency to every write.

Hint

One synchronous follower dedicated specifically to failover satisfies the no-lost-commits requirement, while any number of additional asynchronous followers spread across regions can handle read scaling without adding latency to every write, since they are not relied upon for the strict durability guarantee.