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
SmartHRにおけるアカウントモデルの移行のはなし/Story of migration o...
Search
Takumi KANZAKI
December 08, 2018
Technology
6
2k
SmartHRにおけるアカウントモデルの移行のはなし/Story of migration of account model in SmartHR - Rails Developers Meetup 2018 Day 4 Nouvelle Vague -
Takumi KANZAKI
December 08, 2018
Tweet
Share
More Decks by Takumi KANZAKI
See All by Takumi KANZAKI
新生児〜生後6ヶ月を支えた技術/kosodate-engineer-meetup-3
tknzk
4
2.1k
kosodate_engineer_meetup_2
tknzk
3
5.6k
eb_with_multi_container_docker
tknzk
1
2.3k
AdServer Casual Monitoring by fluentd, Mackerel
tknzk
0
1.7k
Other Decks in Technology
See All in Technology
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
Can We Measure Developer Productivity?
ewolff
1
150
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
100
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
440
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Music & Morning Musume
bryan
46
6.2k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Statistics for Hackers
jakevdp
796
220k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Designing for humans not robots
tammielis
250
25k
Transcript
SmartHRʹ͓͚ΔΞΧ ϯτϞσϧͷҠߦͷ ͳ͠ SmartHR, Inc Takumi Kanzaki (@tknzk)
͓͢Δ͜ͱ B2B SaaS Ͱ͋ΔSmartHR ͕ϓϩμΫτͷʹͱ ͳͬͯཁ͕݅มΘ͍͖ͬͯ B2B αʔϏεͷΞΧϯτϞσϧ͕ B2C αʔϏεͷ
ΞΧϯτϞσϧʹҠߦͭͭ͋͠Δ
SamrtHR ʹ͍ͭͯ • SmartHRਓࣄɾ࿑ͷखଓ͖ΛΧϯλϯʹ͢Δ ΫϥυܕιϑτΣΞͰ͢ • ϚϧνςφϯτΣϒΞϓϦέʔγϣϯ (MTWA) • SmartHR
ຊମ Rails ͷϞϊϦγοΫͳΞϓϦ έʔγϣϯ
SamrtHR ʹ͍ͭͯ • ਓࣄใͷऩू • ೖୀࣾ࣌ͳͲͷ༷ʑͳॻྨͷ࡞ • e-Gov APIΛར༻ͯ͠ͷ༷ʑͳॻྨͷఏग़ •
ޏ༻ܖػೳ • ௐػೳ • ैۀһDB • etc • ར༻ऀ: ਓࣄ࿑୲ऀ (ͱ ސࣾ࿑࢜) ͱ ैۀһ
None
MTWA ʹ͓͚ΔΞΧϯτϞ σϧ • αʔϏεશମͰΞΧϯτΛڞ༗͢Δ • GitHub • EMAIL ͳͲͰҰҙͷΞΧϯτ͕ൃߦ͞Ε
Δ • org ʹটͳͲͰඥ͚ͮ
MTWA ʹ͓͚ΔΞΧϯτϞ σϧ • ςφϯτ͝ͱʹΞΧϯτΛ࡞͢Δ • Slack, Kibela • ςφϯτ͝ͱʹΞΧϯτ͕ൃߦ͞ΕΔ
• ςφϯτͷΓସ͑ = ΞΧϯτͷΓସ ͑
SmartHR ʹ͓͚ΔΞΧϯτ ͱςφϯτͷؔ • σʔλߏతʹαʔϏεશମͰΞΧϯτΛڞ ༗ • ςφϯτͱϢʔβʔΓ͞Ε͍ͯΔΑ͏ʹݟ ͑Δ͕ɺ࣮ଶີ݁߹ •
Tenant ͱ User ͕ user.tenant_id ʹΑͬͯϦ Ϩʔγϣϯ • ͜ΕʹΑΓςφϯτʹΞΫηεͰ͖ΔΞΧϯ τΛ੍ޚ
SmartHR ʹ͓͚ΔΞΧϯτ ͱςφϯτͷؔ • ݖݶཧ • user.role_id Ͱݖݶઃఆ
SmartHR ʹ͓͚ΔΞΧϯτ ͱςφϯτͷؔ • ཁ͢Δʹ • user ʹςφϯτใͱݖݶใΛ͍࣋ͬͯΔঢ়ଶ
B2BαʔϏεʹ͓͚ΔΞΧ ϯτ • ςφϯτཧऀ͕ൃߦͯ͠ཧ͢Δ • ैۀһͷΞΧϯτ • AD ͱ͔ SSO
ͱ͔ SAML ͱ͔ IdP Ͱཧ͍ͨ͠ • ୀ৬ͨ͠Βണୣ/আ • ୀ৬ޙʹࣾͷυΩϡϝϯτͱ͔ΈΕΔͱ·ͣ ͍Ͱ͢ΑͶ?
SmartHRͷΞΧϯτ • ୀ৬ͨ͠Βണୣ? • ൱
SmartHRͷΞΧϯτ • ਓࣄ࿑୲ऀ • ୀ৬ऀʹ৬ථݯઘऩථΛൃߦͨ͠Γɺڅ ༩໌ࡉΛൃߦͨ͠Γ͍ͨ͠ • ୀ৬ऀɺ • աڈͷڅ༩໌ࡉݯઘऩථΛӾཡͨ͠Γͨ͠
͍
SmartHRͷΞΧϯτ • ࣮ձ͕ࣾཧ͢Δͱ͍͏ΑΓɺݸਓʹൃߦͯ͠ ͍Δͷͱߟ͑Δ΄͏Α͍͔͠Εͳ͍ • B2CαʔϏεͷཁ͕݅Ͱ͖ͯͭͭ͋Δ
ൃੜͨ͠ • ͓͔͛͞·Ͱ ϦϦʔε͔Β3ܦա͠ SmartHR Λ ͝ར༻͍ͨͩ͘اۀ͕ॱௐʹ૿Ճ • స৬ઌͰ SmartHR
Λར༻͍ͯ͠Δέʔε • ෳͷόΠτઌͰ SmartHR Λ͝ར༻͍ͯΔ έʔε
ൃੜͨ͠ • SmartHR ͷΞΧϯτϝΞυΛ ID ͱͯ͠ΞΧ ϯτΛൃߦ • ϝʔϧΞυϨε͕ॏෳ͢Δ͕ൃੜ •
ձࣾͷϝʔϧΞυϨε͕ൃߦ͞ΕΔΑΓલʹ SmartHR ΞΧϯτ͕ൃߦ͞ΕΔͨΊɺݸਓ ͷϝΞυΛ͏έʔε͋Δ • ΞϧόΠτͷ߹ɺݸਓͷϝʔϧΞυϨεΛར ༻͢Δέʔε͕ଟ͍
ϝΞυॏෳʹରԠ • ҰͭͷϝΞυͰ ෳͷςφϯτʹΞΫηεͰ͖Ε Ϥαι
ϚϧνϩάΠϯ • Ұͭͷ SmartHR ΞΧϯτͰෳͷςφϯτʹ ΞΫηεͰ͖Δػೳ • ͱͱɺࣾ࿑͚࢜ʹ࣮ • ෳͷސઌͷςφϯτͰཧऀͱͯ͠ϩάΠ
ϯ͍ͨ͠ͱ͍͏ཁ݅ • ݖݶཧಛʹߟྀ͍ͯ͠ͳ͔ͬͨ(ཧऀݖ ݶͷΈͩͬͨͨΊ)
ϚϧνϩάΠϯ • ࣾ࿑͚࢜ͷػೳͰ͋ͬͨͷͰɺಛఆͷϨίʔυ Λ͍࣋ͬͯΔ͔Ͱఆ͢Δ࣮ • ͜ΕΛશମ (ैۀһ͚ͷݖݶ) ʹ։์ͯ͠ɺϝΞ υͷॏෳΛղܾ͢Δ(ͨ͠)
ϚϧνϩάΠϯͷશମެ։ • user.tenant_id, user.role_id ͷͻ͖Λ ΊΔ • தؒςʔϒϧ (user_role) ʹஔ͖͑
• ΞΧϯτ͕ςφϯτʹͲͷݖݶͰΞΫηεͰ ͖Δ͔ͷใΛ࣋ͭ • user.user_role ͕ ςφϯτઐ༻ͷσʔλʹอ࣋ ͞ΕΔ
ϚϧνϩάΠϯͷશମެ։ • user ͕ tenant ͔ΒΓ͞ΕΔ͜ͱʹͳΔ • ΞΧϯτ͕ςφϯτͷ͔Βݸਓͷͷ • B2C
αʔϏεʹ͍͔ۙͨͪ
࣮ • ϚϧνςφϯτͷϛυϧΣΞͱͯ͠ • activerecord-multi-tenant gem Λར༻ • https:/ /github.com/citusdata/activerecord-multi-
tenant/ • (Ҏલ apartment gem Λར༻͍ͯ͠·͕ͨ͠ࠓ ͷ6݄ʹҠߦ)
࣮ • ϚϧνϩάΠϯͷͨΊͷΓସ͑ͷΤϯυϙΠϯ τ https://app.smarthr.jp Ͱఏڙ • app ಛผͳαϒυϝΠϯͰɺςφϯτΛΓସ ͑ͳ͍ঢ়ଶͱ͍͏ѻ͍
• ϩάΠϯɺϚϧνϩάΠϯͷςφϯτΓସ͑ ͳͲΛߦ͏
࣮࣌ʹى͖ͨ͜ͱ • user.user_role ͕ṖʹΩϟογϡ͞Εͯ͠·͏ • app ԼͰ user.user_role Λ৮ͬͯ͠·͏ͱ active-record
͕ΩϟογϡΛ࣋ͬͯ͠·͍ • ຊདྷΞΫηε͖͢Ͱͳ͍σʔλΛऔͬͯ͠·͍ ςφϯτΓସ͑ޙͷڍಈ͕͓͔͘͠ͳΔ
࣮࣌ʹى͖ͨ͜ͱ • ͜ΕΒɺ active-record/multi-tenant ͷվम • ͦͦ ςφϯτΛΓସ͍͑ͯͳ͍ঢ়ଶͰ user.user_role Λ৮Βͳ͍ͳͲͷमਖ਼Λͯ͠ղ
ܾ
SmartHR ʹ͓͚ΔΞΧϯτ ͱςφϯτͷؔ(ݱࡏ) • σʔλߏతʹαʔϏεશମͰΞΧϯτΛڞ ༗ • ςφϯτͱΞΧϯτΓ͞Εͨؔ • ςφϯτͷதͰͲͷݖݶΛ͍࣋ͬͯΔ͔Λఆ
͜Ε͔Β • SmartHR::ID ߏ • B2CϕʔεͳΞΧϯτϞσϧ + ݸਓใαʔϏ ε
None
None
None
SmartHR::ID ߏ • SmartHR ͷΞΧϯτΛ͍࣋ͬͯΕస৬స੶ Λͨ͋͠ͱͰɺաڈͷࣗͷैۀһใͳͲΛ ӾཡͰ͖Δ • څ༩໌ࡉͱ͔ݯઘऩථͱ͔ •
ैۀһใΛաڈॴଐ͍ͯͨ͠اۀ͔Βస৬ઌ ʹ 1 click Πϯϙʔτͨ͠Γ • ϚΠφϯόʔͷ༬͔Γอ (๏্͋Εͳ ͋Γ·͢.. )
SmartHR::ID ߏ • ࣾձΠϯϑϥ(ͷՄೳੑ)ͱ͍͖ͯͬͯ͠
We are hiring! • Ұॹʹࣾձج൫ΛϋοΫ͢ΔؒืूதͰ͢ • དྷ SmartHR::ID ߏΛ۩ମԽͤ͞Δ༧ఆͳͷͰ ҰॹʹΓ·ͤΜ͔ʂ
• ࢲ͕த৺ͳΔ༧ఆͰ͢ʂ • SSO ͱ͔ SAML ͱ͔AD ͱ͔ৄ͍͠ํ͜ͷ͋ͱ͓ ͠·ͤΜ͔ʂ
Who • @tknzk ( Takumi Kanzaki ) • SmartHR ιϑτΣΞΤϯ
δχΞ