CAP and PACELC
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Layer 3 · Go deeper · 8 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How long is one round trip from Mumbai to Singapore, at best?

      How many replicas must a CP store run to survive two failures?

        Build-up · 6 steps

        From one partition to PACELC

        Two servers, one value and a cut link. Step through the proof, then see the choice that stays when the link heals.

        Step 1 of 6

        Two replicas, one value

        G1 and G2 both store x = 0 and copy every write to each other, so either can serve a client. Availability forces this replication on you.

        4 interview moments

        You’re the candidate

        The interviewer pushes on the hard parts. Pick an approach and see how it holds up.

        1. Deep dive 1 of 4

          Interviewer

          “You’re designing a tatkal-style booking flow. Which parts should stay consistent during a partition, and which should stay available?”

          Your move. Pick an approach:

        2. Deep dive 2 of 4

          Interviewer

          “A partition hits while a UPI-style debit is in flight, and the ledger can’t reach a majority. What does the user see?”

          Your move. Pick an approach:

        3. Deep dive 3 of 4

          Interviewer

          “Each key lives on N = 3 replicas. Reads should reach the latest acknowledged write. How do you set W and R?”

          Your move. Pick an approach:

        4. Deep dive 4 of 4

          Interviewer

          “Two people try to claim the same username at the same moment, on a store running R + W > N. Is that enough?”

          Your move. Pick an approach:

        Build-up · 5 steps

        Make every read meet the latest write

        N = 3, W = 2, R = 2, the Dynamo paper’s most common setting. Watch the write set and the read set overlap.

        Step 1 of 5

        Three replicas per key

        N is the number of replicas that store each key. Here N = 3, and all three hold version 1 of x.