Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kyash法人送金サービスでのトランザクション管理について
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Manabu Ejima
April 18, 2022
Technology
950
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kyash法人送金サービスでのトランザクション管理について
Manabu Ejima
April 18, 2022
Other Decks in Technology
See All in Technology
遠藤な_めぐろLT #38 「社内のAI活用推進」@麻布台_20261009
endonanana
0
120
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
3
820
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
AIは「聞けば答える」から「任せると自分で進める」へ - JACTIMペナン地域部会・ペナン三水会講演
knishioka
0
110
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
1
250
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
890
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
0
610
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
110
Loop Engineering, beyond prompt, context, and harness engineering
glaforge
0
100
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
120
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
140
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
480
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
360
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Git: the NoSQL Database
bkeepers
PRO
433
67k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
470
My Coaching Mixtape
mlcsv
0
350
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Transcript
Kyash 法人送金サービスでの トランザクション管理について Kyash TechTalk #2 - Serverside のシステム構成とアーキテクチャ 2022
年4 月18 日 Manabu Ejima 1
今日の内容 複数のマイクロサービスにまたがるトランザクション管理の設計の 話 Saga パターンとかではない シーケンス図を使って説明します 2
Kyash 法人送金サービスとは ギグワーカーの人たちがオンデマンドで売上金/ 報酬を即座にKyash 残 高に送金できるようにするサービス 3
ギグワーカーのメリット いつでも受取可能 ポイント還元 ATM などで現金化も可能 4
プラットフォーマーのメリット 安価な送金手数料 API 連携 他社との競争優位性向上 5
Kyash のメリット 手数料を収益源にできる 新規ユーザー獲得 6
導入検討お願いします https://www.kyash.co/lp/kyash-for-business-account 7
振り込み API のトランザクションの話 8
用語の整理 以降社内で使われている呼び方を使います Kyash 法人送金サービス -> Payout ギグワーカー -> ユーザー プラットフォーマー
-> パートナー 9
振り込み API の内部処理 トランザクションの記録 パートナーからの出金 ユーザーの存在確認 ユーザーへの入金 入金履歴の保存 会計用データの保存 お知らせの保存
Push 通知 10
サービスごとの役割 Payout サービス トランザクションの記録 パートナーからの出金 11
サービスごとの役割 Topup サービス ユーザーの存在確認 ユーザーへの入金 会計用データの保存 入金履歴の保存 お知らせの保存 12
サービスごとの役割 Notification サービス Push 通知 13
シーケンス図の中で使われる処理 シンプルにするため以下に絞る Payout サービス トランザクションの記録 パートナーからの出金 Topup サービス ユーザーへの入金 14
同期処理だけの場合 とりあえずたたき台 どういう問題が発生するか探る 15
16
17
18
19
同期処理だけでやろうとすると 入出金処理がアトミックにならない 入金だけ残った場合リカバリが完了する前にユーザーに使われて しまう可能性 出金だけ残った場合リカバリが完了する前にパートナーの口座が 残高不足になる可能性 振り込み失敗したにもかかわらず履歴・お知らせ・Push 通知などが 記録・送信されてしまう 入出金キャンセル時にリカバリが必要
20
非同期処理を導入する Topup 側を変更 トランザクションを2 段階にする リクエスト 確定 or キャンセル トランザクションを記録する
SQS を使って非同期で入金の確定・キャンセル処理をする 21
22
23
24
同期処理の場合の問題点 入出金処理がアトミックにならない 履歴・お知らせ・Push 通知などが記録・送信されてしまう 入出金キャンセル時にリカバリが必要 25
非同期処理を導入することによって 入出金処理がアトミックにならない アトミックに近い状態になる ただしタイミングによっては入出金キャンセルが間に合わない 場合がある 履歴・お知らせ・Push 通知などが記録・送信されてしまう 確定時しか記録・送信されないようになる 入出金キャンセル時にリカバリが必要 自動リカバリできるようになる
26
27
ご清聴ありがとうございました! 28