Busy database
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 · 7 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.

    Can a 16-vCPU primary serve 500 order summaries a second?

      How many database connections does the summary endpoint hold?

        200,000 restaurants poll a dashboard every 30 s. How much aggregation is that?

          Build-up · 6 steps

          Move the work off the primary

          The same system from busy to fixed. Each step takes one kind of work off the one box you can’t scale out, and says what it costs.

          Step 1 of 6

          One primary, every request

          Every endpoint, cron job and analyst shares one primary. It’s the only node that takes writes, and the hardest tier to scale.

          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

            “Your primary is at 95% CPU and the app servers are at 15%. What do you do?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Checkout slows at peak and database CPU is high. How do you tell a busy database from a missing index or lock contention?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “Finance’s 11 am dashboard runs a GROUP BY over 18 months of orders on the primary. Where should it run?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “200,000 restaurants poll an orders-per-hour dashboard every 30 seconds. How do you serve it?”

            Your move. Pick an approach: