CSE Roadmap

Common tier · about 2 hours · 5 parts

Part 5 of 5 · 5 min read

Exercises

Easy

Easy 1: Name what a standby is (15 minutes)

State, in one sentence, what a standby system is.

Done when: a separate, running copy of the database, continuously kept up to date, ready to take over is correctly described.

Hint

A separate, running copy of the database, continuously kept up to date, ready to take over if the primary fails.

Easy 2: Name how a standby stays current (15 minutes)

State what mechanism keeps a standby's data current with the primary.

Done when: log shipping, continuously receiving and replaying the write-ahead log, is correctly named.

Hint

Log shipping, continuously receiving and replaying the primary's write-ahead log entries.

Easy 3: Name the risk failover carries (15 minutes)

State what can be lost during failover.

Done when: any log entries still in transit, not yet received and replayed by the standby, at the moment of failure is correctly named.

Hint

Any log entries that were sent by the primary but not yet received and replayed by the standby at the moment of failure.

Medium

Medium 1: Compare standby recovery speed to backup restore speed (25 minutes)

Explain why failing over to an already-running standby is generally much faster than restoring from a backup.

Done when: the explanation correctly notes the standby is already running and already nearly caught up via continuous log shipping, while a backup restore must actively reconstruct the database state from scratch, taking real additional time.

Hint

The standby is already running and already nearly caught up through continuous log shipping, while a backup restore must reconstruct the database state from scratch, which takes real additional time.

Medium 2: Decide the trade-off for a latency-sensitive application (25 minutes)

An application has very strict commit latency requirements, but can tolerate a small risk of losing the most recent few transactions in a rare failover event. Decide whether synchronous or asynchronous replication fits better, and explain why.

Done when: asynchronous replication is correctly chosen, citing the priority on commit latency and the application's explicitly stated tolerance for a small, rare risk of recent data loss.

Hint

Asynchronous replication, since the application prioritizes commit latency and has explicitly stated it can tolerate the small, rare risk of losing the most recent transactions.

Medium 3: Decide the trade-off for a financial application (30 minutes)

An application absolutely cannot tolerate losing a committed transaction, even in a rare failover event, and can accept added commit latency as a result. Decide whether synchronous or asynchronous replication fits better, and explain why.

Done when: synchronous replication is correctly chosen, citing the requirement to never lose a committed transaction, even at the cost of the added latency synchronous replication imposes on every commit.

Hint

Synchronous replication, since the application cannot tolerate losing a committed transaction under any circumstances, and has explicitly accepted the added latency cost in exchange for that guarantee.

Hard

Hard 1: Explain why synchronous replication's latency cost is unavoidable (30 minutes)

Explain why synchronous replication cannot avoid adding latency to every commit, no matter how fast the network connection to the standby is.

Done when: the explanation correctly notes that even a very fast network still has some nonzero round-trip time, and since the primary must wait for the standby's confirmation before considering the transaction committed, that round-trip time is necessarily added to every single commit, regardless of how small it is.

Hint

Even a very fast network has some nonzero round-trip time, and since the primary must wait for the standby's confirmation before committing, that round-trip time is unavoidably added to every commit, however small it may be.

Hard 2: Explain why asynchronous replication's risk is bounded, not unlimited (35 minutes)

Explain why asynchronous replication's risk during failover is generally limited to only the most recent transactions, rather than risking the loss of the entire database's history.

Done when: the explanation correctly notes that log shipping continuously keeps the standby nearly caught up, so only the small window of log entries sent but not yet confirmed received at the exact moment of failure is actually at risk, with everything received and replayed earlier already safely reflected on the standby.

Hint

Continuous log shipping keeps the standby nearly caught up at all times, so only the small window of entries sent but not yet confirmed at the exact moment of failure is actually at risk, with everything received earlier already safely reflected on the standby.

Hard 3: Combine a standby with the backup strategy from the previous page (40 minutes)

Explain why a business-critical system would generally want both a standby, covered on this page, and a separately stored backup with point-in-time recovery, covered on the previous page, rather than relying on only one of the two.

Done when: the explanation correctly notes a standby protects against a primary failure with fast failover but does not protect against a human mistake that gets replicated to the standby just as quickly as it hit the primary, while a backup with point-in-time recovery specifically protects against exactly that human-error case, so the two mechanisms address different failure scenarios and are best used together.

Hint

A standby protects against a primary failure via fast failover, but a human mistake replicates to the standby just as quickly as it hits the primary, so it offers no protection there; a backup with point-in-time recovery specifically protects against that human-error case, so a business-critical system generally benefits from using both mechanisms together, each addressing a failure scenario the other does not.