Monolithic persistence
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.

    What share of the database’s writes is the business?

      Why do event pages push order pages out of memory?

        How fast do one-event-per-commit inserts age every table?

          How long until checkout is back after losing the primary?

            Build-up · 6 steps

            Split the database by access pattern

            One primary holding everything, emptied one workload at a time, biggest and least valuable first, until checkout’s database holds what must commit together.

            Step 1 of 6

            Everything in one primary

            Orders share CPU, cache, WAL, connections and a 2 TB backup with telemetry, audit rows, PDFs, sessions and a polled jobs table.

            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

              “Client taps, scrolls and rider GPS pings are 75% of the primary’s row writes. Where should they go?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “Invoice PDFs live in a bytea column, about 15 KB each, and write a tenth of the WAL. What do you change?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “A regulator needs each audit row in the same transaction as its order. Audit is 250 GB and growing. What do you do?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “A new product does 2 orders a second on 20 GB. A teammate wants Kafka, Redis, S3 and a warehouse from day one. Your call?”

              Your move. Pick an approach: