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
Chris Stefano
February 06, 2014
Programming
1
93
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
43
Rails 3 Generators
virtualstaticvoid
0
42
Other Decks in Programming
See All in Programming
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
210
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
720
CDK引数設計道場100本ノック
badmintoncryer
2
590
「次に何を学べばいいか分からない」あなたへ──若手エンジニアのための学習地図
panda_program
3
680
AIに安心して任せるためにTypeScriptで一意な型を作ろう
arfes0e2b3c
0
290
MCPで実現できる、Webサービス利用体験について
syumai
7
2.2k
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
190
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
8
1.1k
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
300
バイブコーディング超えてバイブデプロイ〜CloudflareMCPで実現する、未来のアプリケーションデリバリー〜
azukiazusa1
2
740
階層化自動テストで開発に機動力を
ickx
1
450
フロントエンドのパフォーマンスチューニング
koukimiura
6
2.3k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Six Lessons from altMBA
skipperchong
28
3.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How GitHub (no longer) Works
holman
314
140k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
A Tale of Four Properties
chriscoyier
160
23k
Building Adaptive Systems
keathley
43
2.7k
Documentation Writing (for coders)
carmenintech
72
4.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Navigating Team Friction
lara
188
15k
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