Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Multi-tenancy in Rails
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Chris Stefano
February 06, 2014
Programming
1
100
Multi-tenancy in Rails
Overview of multi-tenancy in Rails and the apartment gem. Presented at RubyFuza 2014
Chris Stefano
February 06, 2014
Tweet
Share
More Decks by Chris Stefano
See All by Chris Stefano
Deploying with Heroku
virtualstaticvoid
1
46
Rails 3 Generators
virtualstaticvoid
0
43
Other Decks in Programming
See All in Programming
AI時代の認知負荷との向き合い方
optfit
0
160
CSC307 Lecture 02
javiergs
PRO
1
780
CSC307 Lecture 05
javiergs
PRO
0
500
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
CSC307 Lecture 01
javiergs
PRO
0
690
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
CSC307 Lecture 04
javiergs
PRO
0
660
SourceGeneratorのススメ
htkym
0
190
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
120
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
180
Code Review Best Practice
trishagee
74
20k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
57
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
64
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Chasing Engaging Ingredients in Design
codingconduct
0
110
The Curious Case for Waylosing
cassininazir
0
230
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Transcript
Multi-tenancy in Rails by Chris Stefano @virtstaticvoid Lightning Talk
The next killer app...
@tenderlove
@lgleasain
@moomoo
Multi-tenant Application
Icons by dryicons.com User is the tenant
Group of users is the tenant Icons by dryicons.com
Data?
Icons by dryicons.com Single database, tenant column
Icons by dryicons.com Database per tenant
Icons by dryicons.com Single database, schema per tenant
Requirements Icons by dryicons.com Icons by dryicons.com
Which tenant? Icons by dryicons.com
Safe data boundaries Icons by dryicons.com
Shared data? Icons by dryicons.com
Unobtrusive code
Specs + Fixture Data
Abstracts the database as an apartment
Use an elevator to activate apartment for tenant
None
None
Features ➢ Supported RDBMS Sqlite, MySQL, JDBC, Postgres & PostGIS
➢ Configuration Shared models, multi-schema, single or multi-database ➢ DB Migration support rake apartment:migrate ➢ Tenant Switching Rack middleware - host, domain, subdomain and custom ➢ Support for Background Workers delayed_job, sidekiq, resque
More Information ➢ RailsCasts #389 (Pro Subscription) http://railscasts.com/episodes/389-multitenancy-with-postgresql ➢ Multi-tenancy
with Rails (LeanPub Book) http://leanpub.com/multi-tenancy-rails ➢ apartment (Gem) http://github.com/influitive/apartment ➢ multitenant (Gem) http://github.com/wireframe/multitenant ➢ roomer (Gem) http://github.com/gosuri/roomer
Thank You Chris Stefano github.com/virtualstaticvoid @virtstaticvoid