Skip to content
seekho.
← Build Production-Ready SaaS Applications

Whole course on one page

Build Production-Ready SaaS Applications: 8 lessons, a few lines each. About 5 minutes to read. Use it to preview the course or to revise.

SaaS Foundations and Multi-Tenancy

  1. 1. What Makes an App a SaaS opens the one-minute view

    A SaaS is one shared app that many paying customers use online. Each customer's data must stay separate. So every row records which customer it belongs to.

    Steps: 1. Pick a simple SaaS idea · 2. List the tenants and their users · 3. List your three main tables · 4. Add an org_id column

    ✗ Creating a customer data table with no org_id ✓ Put org_id on every table that holds customer data

    Words: SaaS, Subscription, Tenant, Tenant isolation

    📌 In SaaS, every row belongs to someone, and the code must always know who.

  2. 2. Enforcing Tenant Isolation opens the one-minute view

    Tenant isolation means one customer never sees another customer's data. Build it in two layers. One helper filters every query, and the database also refuses other tenants' rows.

    Steps: 1. Write one tenantDb helper · 2. Look up by id and orgId together · 3. Turn on row-level security · 4. Connect as a separate, limited role · 5. Test org A asking for org B's data

    ✗ Loading a project by its id alone ✓ Filter by id and orgId together

    Words: Row-level security (RLS), Central helper, Policy

    📌 Make the safe path the only path. Isolation should be automatic.

Accounts, Permissions and Billing

  1. 3. Authentication, Sessions and Roles opens the one-minute view

    Authentication checks who a person is. Authorisation checks what that person may do. The server must check permission on every request.

    Steps: 1. Use a well-maintained auth library · 2. Keep the session id in a safe cookie · 3. Add a memberships table · 4. Call assertCan in every changing route · 5. Test that a viewer cannot delete

    ✗ Hiding the Delete button and stopping there ✓ Hide the button and check the role on the server

    Words: Authentication, Authorisation, Session, Role

    📌 The UI can hide buttons, but only the server can lock doors.

  2. 4. Subscription Billing and Webhooks opens the one-minute view

    A payment provider handles the cards and the money. It sends your server a message, called a webhook, when something changes. Your app checks the message and updates the plan.

    Steps: 1. Send the user to hosted checkout · 2. Verify the webhook signature · 3. Check if the event id was seen · 4. Update the subscriptions table · 5. Read that table for plan features

    ✗ Applying every webhook the moment it arrives ✓ Verify the signature and skip event ids already handled

    Words: Webhook, Idempotent, Signature, Entitlements

    📌 The provider owns the money. Your app trusts only verified webhooks.

  3. 5. Background Jobs, Email and Reliability opens the one-minute view

    Slow or risky work, like sending email, should not run inside a web request. Put it on a job queue. A separate worker does it and retries if it fails.

    Steps: 1. Add the slow action to a queue · 2. Let a worker process the job · 3. Set retries with backoff · 4. Make the job safe to repeat · 5. Move failed jobs to a dead-letter queue

    ✗ Writing a job that sends the email every time it runs ✓ Check if it was already sent before sending

    Words: Job queue, Worker, Backoff, Dead-letter queue

    📌 Reply fast, do slow work in the background, and make every job safe to repeat.

Operating a SaaS in Production

  1. 6. Safe Migrations, Backups and Deployments opens the one-minute view

    Change a live database in small steps that work with old and new code. Add the new part first and remove the old part last. Test that your backups can be restored.

    Steps: 1. Expand: add the new column · 2. Backfill old data in small batches · 3. Switch: read from the new column · 4. Contract: drop the old column · 5. Practise restoring a backup

    ✗ Renaming the column and deploying new code together ✓ Add, write to both, backfill, switch, then drop

    Words: Expand and contract, Backfill, Feature flag, Rollback

    📌 Every change should be small, reversible and tested on a restore.

  2. 7. Observability, Incidents and Scaling Up opens the one-minute view

    Measure what customers feel, such as errors and slow pages. Follow a clear process when something breaks. Then fix the real bottleneck you measured.

    Steps: 1. Add requestId and orgId to every log · 2. Write one SLO for your main page · 3. Name one incident lead · 4. Tell customers early on a status page · 5. Add per-tenant rate limits

    ✗ Hunting for the root cause while customers are still affected ✓ Roll back first, then find the root cause later

    Words: SLO, Incident lead, Blameless review, Noisy neighbour

    📌 Measure what users feel, act calmly, and fix the real bottleneck.

  3. 8. Final Project: A Production-Ready Team Workspace opens the one-minute view

    You build a small team workspace app for many organisations. It shows each practice from the course: separate data, roles, billing, a background job, logs and a runbook.

    Steps: 1. Write the isolation test first · 2. Add sign-in and server-side roles · 3. Add test-mode billing with two plans · 4. Add one background job · 5. Add logs, one SLO and a runbook

    ✗ Leaving the isolation test until the end ✓ Write the isolation test first

    Words: Multi-tenant, Runbook, Test mode

    📌 Start with the isolation test, then add each practice one at a time.

This page is a summary. It does not replace the lessons, where each idea has an example, pictures and practice.