Scaling reads
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 · 9 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 many read replicas would 100,000 views a second need?

      At 100,000 reads a second, how many misses reach the database?

        What does fan-out-on-write cost when a celebrity posts?

          50,000 keys load at 10:00 with a 300 s TTL. When do they expire?

            Build-up · 6 steps

            Climb the ladder, one rung at a time

            The sale-day product page, from one slow primary to a layered read path. Each step adds one rung and says what it buys and what it costs.

            Step 1 of 6

            Fix the queries

            Index the access path, fetch all ten authors in one query and select only what you render. One node goes from about 300 to 5,000 views a second.

            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

              “Sale day needs 100,000 product views a second, and one node serves about 5,000. The team wants more read replicas. Your call?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “Asha saves a new delivery address, and the reload shows the old one. What do you change?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “Your database is sized for 1,000 misses a second behind Redis. The cache cluster goes down. What happens, and what’s your plan?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “At 12:00 the hero deal draws 100,000 reads a second on one cache key, more than one shard can take. What do you do?”

              Your move. Pick an approach: