Skip to content
Now boarding New: Mobile & Desktop platform and an open-fare snippet depot — pay €1 to €100. See new lines Code WELCOME10 takes 10% off your first ticket · 14-day refund
Backend & API Modules Advanced Save 9%

Line KJ-112 Platform 3 · Backend & API Modules

Multi-Tenant Switchyard for Postgres

Row-level security patterns, migrations and tooling to isolate tenants inside one PostgreSQL database.

96 builders

LH Maintained by Lars Holm

  • Last updated October 2026
  • English
  • 1h 25m of walkthroughs
  • 41 files

What you get

5 items in the box

Every bullet below is in the download, working, the moment your payment clears.

  • Row-level security policies for tenant isolation
  • Session-variable tenancy that works with PgBouncer
  • Migrations to add tenancy to an existing schema
  • Per-tenant export and deletion tooling
  • A cross-tenant leak test harness for CI

What's in the box

4 parts · 41 files · 1h 25m of walkthroughs

12 files with a 26m walkthrough video. This part is documented in the architecture guide, with notes on every decision and how to change it for your own project.

The full file tree and the walkthroughs are in your download, available straight after checkout.

8 files with a 19m walkthrough video. This part is documented in the architecture guide, with notes on every decision and how to change it for your own project.

The full file tree and the walkthroughs are in your download, available straight after checkout.

10 files with a 23m walkthrough video. This part is documented in the architecture guide, with notes on every decision and how to change it for your own project.

The full file tree and the walkthroughs are in your download, available straight after checkout.

11 files with a 17m walkthrough video. This part is documented in the architecture guide, with notes on every decision and how to change it for your own project.

The full file tree and the walkthroughs are in your download, available straight after checkout.

4 parts · 41 files

1h 25m total length

You will need

Short list, and deliberately so. If you meet these you can start today.

  • Solid SQL and PostgreSQL experience
  • PostgreSQL 15 or newer

About this product

Switchyard is a set of SQL migrations, policies and small tools that use PostgreSQL row-level security to enforce tenant isolation in the database itself, so a bug in application code cannot return another tenant's rows.

It covers the policy templates, a session-variable pattern that works with connection pooling, tenant-aware indexes, safe migrations for adding tenancy to an existing schema, per-tenant export and deletion for GDPR requests, and a test harness that tries to read across tenants and fails the build if it can. Example integrations are provided for Go, Node and Laravel.

Frequently asked questions

Still unsure about something? Write to our contact page and a human answers, usually the same working day.

Usually negligibly with the right indexes. The guide includes benchmarks and the index patterns that keep plans fast.

Checkout is handled on our provider's secure payment page. The moment your payment clears we email your personal access link and access code to the address you used at checkout, and the same link appears in your account library. There is nothing to install and nothing to wait for.

Email within 14 days of your purchase, quote your order number, and we refund the full amount to your original payment method. No form to fill in and no questions about how much of the product you watched.

What builders say

No reviews yet

Nobody has reviewed this product yet, so there is no score to show. Buy it, work through it, and your review could be the one that helps the next developer decide.

Your maker

LH

Lars Holm

Go and Rust engineer with a security habit

  • 2,427 builders aboard
  • 11 products published
  • 5.0 maker rating
  • Go
  • Rust
  • PostgreSQL
  • Application security
  • Linux hardening

Lars started out in penetration testing and moved into backend engineering, so he writes Go services the way an attacker would read them. He maintains the Go API and Postgres tenancy modules and the whole Security line. His audit kits explain the reason behind every check, because a checklist nobody understands gets skipped.

€81 EUR €89 Discounted from €89. You save 9 percent.

One-time payment · lifetime access

Timetable updates

New lines, first. One email when something departs.

Release notes for new products and major updates to the ones you own, plus launch fares for subscribers. No digest padding, unsubscribe in one click.

By subscribing you agree to our Privacy Policy.