Multi-tenant SaaS
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 · 11 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 requests a second at the busiest hour?

      How many cells, and how many tenants in each?

        How many database connections would a database per tenant need?

          What does a free tenant cost a month?

            Build-up · 6 steps

            Build the high-level design

            One functional requirement at a time, ending with a platform that works for a few thousand tenants.

            Step 1 of 6

            Sign up in seconds

            The tenant API replies at once and starts an idempotent workflow: place, seed, create the identity realm, publish the directory entry. Only then does the host resolve; a pooled tenant is live in about five seconds.

            6 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 6

              Interviewer

              “Fifty thousand companies’ tickets live in your databases. How do you make sure no bug ever shows one tenant another’s?”

              Your move. Pick an approach:

            2. Deep dive 2 of 6

              Interviewer

              “Caches, search, queues, storage and logs hold tenant data too. Where does each hop get the tenant from?”

              Your move. Pick an approach:

            3. Deep dive 3 of 6

              Interviewer

              “Sixty thousand requests a second must each reach the one cell that holds its tenant. How does the router decide?”

              Your move. Pick an approach:

            4. Deep dive 4 of 6

              Interviewer

              “One tenant’s new integration polls your API in a tight loop while its bulk import runs. How do you protect its neighbours?”

              Your move. Pick an approach:

            5. Deep dive 5 of 6

              Interviewer

              “A 300 GB business tenant has outgrown its pooled cell. How do you move it to a dedicated cell?”

              Your move. Pick an approach:

            6. Deep dive 6 of 6

              Interviewer

              “Build v413 is ready for 36 cells and 50,000 tenants. How do you ship it without risking them all?”

              Your move. Pick an approach:

            Build-up · 7 steps

            Follow one request through it

            The request path is the router, one cell and its stores. Everything that knows about all tenants lives in the control plane, off that path.

            Step 1 of 7

            Route

            A user opens acme.helpdesk.example or support.acme.com. The edge terminates TLS, and the router maps the host to tenant acme and cell in-p07 from its in-memory directory.