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.3k
運用中の 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
450
詳解 WindowInsets
ytakahashi
3
2.3k
Navigation Architecture Component によるアプリ内遷移の管理
ytakahashi
14
6.4k
MotionLayout Basics
ytakahashi
3
810
Other Decks in Programming
See All in Programming
なぜ宣言的 UI は壊れにくいのか / Why declarative UI is less fragile
uenitty
29
13k
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
日付と正規化
megmogmog1965
0
140
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
AHC035解説
terryu16
0
730
CSC307 Lecture 10
javiergs
PRO
0
310
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
1
450
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
DDDを志して3年経ったら「DDDの皮を被ったクリーンアーキテクチャ」になった話【デブサミ2024夏】
texmeijin
1
620
DMMプラットフォームにおけるTiDBの導入から運用まで
pospome
7
3k
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
35
4.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
245
1.2M
Design by the Numbers
sachag
277
18k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
35
6.3k
What's new in Ruby 2.0
geeforr
338
31k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
Building an army of robots
kneath
301
42k
4 Signs Your Business is Dying
shpigford
178
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
Automating Front-end Workflow
addyosmani
1362
200k
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