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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yuta Takahashi
August 25, 2022
Programming
3k
1
Share
運用中の Rails アプリをマルチテナント対応して新規サービスをリリースするまでの道のり
2022/08/25 開催
【Railsエンジニア集合!】身近だけど知らないtoBサービスの裏側をのぞく
https://estie.connpass.com/event/255928/
Yuta Takahashi
August 25, 2022
More Decks by Yuta Takahashi
See All by Yuta Takahashi
開発チームの生産性向上に取り組む
ytakahashi
1
670
詳解 WindowInsets
ytakahashi
4
3.1k
Navigation Architecture Component によるアプリ内遷移の管理
ytakahashi
14
7.2k
MotionLayout Basics
ytakahashi
3
920
Other Decks in Programming
See All in Programming
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
740
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.6k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
へんな働き方
yusukebe
6
2.9k
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
280
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Facilitating Awesome Meetings
lara
57
6.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Design in an AI World
tapps
0
190
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
190
Game over? The fight for quality and originality in the time of robots
wayneb77
1
150
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Raft: Consensus for Rubyists
vanstee
141
7.4k
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