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
運用中の Rails アプリをマルチテナント対応して新規サービスをリリースするまでの道のり
Search
Yuta Takahashi
August 25, 2022
Programming
1
2.9k
運用中の Rails アプリをマルチテナント対応して新規サービスをリリースするまでの道のり
2022/08/25 開催
【Railsエンジニア集合!】身近だけど知らないtoBサービスの裏側をのぞく
https://estie.connpass.com/event/255928/
Yuta Takahashi
August 25, 2022
Tweet
Share
More Decks by Yuta Takahashi
See All by Yuta Takahashi
開発チームの生産性向上に取り組む
ytakahashi
1
630
詳解 WindowInsets
ytakahashi
4
3k
Navigation Architecture Component によるアプリ内遷移の管理
ytakahashi
14
7k
MotionLayout Basics
ytakahashi
3
890
Other Decks in Programming
See All in Programming
Making Angular Apps Smarter with Generative AI: Local and Offline-capable
christianliebel
PRO
0
100
iOSでSVG画像を扱う
kishikawakatsumi
0
180
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
9.4k
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
230
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.7k
オンデバイスAIとXcode
ryodeveloper
0
370
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
220
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
NIKKEI Tech Talk#38
cipepser
0
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
150
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
5
1.1k
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Raft: Consensus for Rubyists
vanstee
140
7.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Context Engineering - Making Every Token Count
addyosmani
8
330
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
For a Future-Friendly Web
brad_frost
180
10k
Transcript
Rails 2 022 . 8 . 2 5 Thu
toB
yt-tkhs yt_hizi Android 2021 7 Flutter / Rails
: atohama SaaS
UUUO atohama 1 Rails ߪೖऀ༻ΞϓϦ ग़༻ΞϓϦ ߪೖऀ༻ΞϓϦ αʔόʔ
( )
: https://d 1 .awsstatic.com/whitepapers/ja_JP/saas-tenant-isolation-strategies.pdf
: https://d 1 .awsstatic.com/whitepapers/ja_JP/saas-tenant-isolation-strategies.pdf
citusdata/activerecord-multi-tenant gem User.all SELECT * FROM users; SELECT * FROM
users WHERE tenant_id = 1;
⾒ ID (Push )
ID (Push )
ID class Organization UUUO_ID = 1.freeze def uuuo? id ==
UUUO_ID end end
ID :
( ) ( ) ( )
None
( )
Before 1 . 2 . 1 . 2 . 3
. After
Before 1 . 2 . 1 . 2 . 3
. After
class Organization def tenant_owner? id == tenant.owner_organization_id end def tenant_admin?
is_admin end end
class Organization def tenant_owner? id == tenant.owner_organization_id end def tenant_admin?
is_admin end end ID
class Organization def tenant_owner? id == tenant.owner_organization_id end def tenant_admin?
is_admin end end
: ID
ID ID UUUO atohama ߪೖऀ༻ΞϓϦ ग़༻ΞϓϦ ߪೖऀ༻ΞϓϦ αʔόʔ
ID Push ID Push UUUO jp.uuuo.maehama jp.uuuo.atohama A jp.uuuo.atohama.xxx
ID ID ( DB ) ID
ID : ID ⾒
⾒ ID (Push )
None
citusdata/activerecord-multi-tenant
Thank you! microsoft/fluentui-emoji: https://github.com/microsoft/fluentui-emoji/blob/main/LICENSE