Scaling writes
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 much does the delivery fleet write?

      How much does batching help one database node?

        How much lag does a reconnect storm cause behind a log?

          How do you cut the writes on one hot zone counter?

            Build-up · 6 steps

            One log, three stores shaped for their readers

            The final design for delivery pings. Ingest writes once; each consumer reads the same log at its own pace and writes a store shaped for how its data is read.

            Step 1 of 6

            Ingest appends, then replies

            The API appends each ping to a Kafka topic keyed by partner ID, with acks=all, and replies OK once the log has it. Nothing else happens in the request.

            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

              “One PostgreSQL node takes about 18,000 single-row writes a second, and you need 125,000. What do you change first?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “A two-minute outage ends, and 100,000 phones upload 30 buffered pings each within 20 seconds. How does ingest survive?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “The ping trail has outgrown one database. Which partition key do you shard it by?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “A viral post gets a million likes a minute, about 16,700 a second on one counter. How do you count them?”

              Your move. Pick an approach: