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
2.1k
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
生成AIのガバナンスの全体像と現実解
fnifni
1
190
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
120
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
530
podman_update_2024-12
orimanabu
1
270
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
180
5分でわかるDuckDB
chanyou0311
10
3.2k
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
なぜCodeceptJSを選んだか
goataka
0
160
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Side Projects
sachag
452
42k
What's in a price? How to price your products and services
michaelherold
243
12k
Rails Girls Zürich Keynote
gr2m
94
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
How GitHub (no longer) Works
holman
311
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building Adaptive Systems
keathley
38
2.3k
The Pragmatic Product Professional
lauravandoore
32
6.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
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 ιϑτΣΞΤϯ
δχΞ