SaaS on Rails on PostgreSQL
summary
Covers concrete recipes for multi-tenant Rails on PostgreSQL using a sample Rideshare app: add company_id to rows, optional composite PKs (Active Record 7.1), use acts_as_tenant or schema tools like Apartment gem, and leverage Postgres features—LIST partitioning plus DETACH CONCURRENTLY (Postgres 14) for fast tenant archiving. Compares app-level Active Record Horizontal Sharding (Rails 6.1) versus Citus for row-based and Citus schema-based sharding, notes replication, resharding costs, and when per-tenant DBs or shared-instance designs actually scale.
AI-written summary · about
chapters (8)
- 0:00Intro
- 0:39Overview of the presentation
- 1:10Definition of terms
- 5:36Adding multi-tenancy to Rideshare application
- 12:55Scaling beyond a single PostgreSQL instance
- 14:27Multi-Tenancy and Sharding with Active Record
- 17:02Citus and Sharding
- 22:52Wrap Up and Advice
related talks
25mMultitenancy with Rails
28mDivide and Conquer: Multi-tenancy in Postgres
18mBuilding Performant Data Architecture for Multi-Tenant SaaS Apps
39mPostgres & Rails 6 Multi-DB: Pitfalls, Patterns, Performance
14mEasier Queries for Multi-Tenant SaaS Apps
27mMulti-tenant Saas apps made simple on Azure Cosmos DB for PostgreSQL
30mMulti-tenancy strategies with Django+PostgreSQL
52mScaling a Saas application beyond a single Postgres with Citus
