SlideShare a Scribd company logo
Transaction Puzzlers
Advanced Topics

appengine ja night #4
@ashigeru
2種類の並⾏性制御
  悲観的並⾏性制御                         楽観的並⾏性制御
     リソースを独占し、                          リソースを独占できな
     他人を待たせる                            かったら、やり直し
  特徴                               特徴
     他人に迷惑をかける                          他人に迷惑をかけない
     成功確率が⾼い                            失敗し続ける場合も
     常にオーバーヘッド                          成功すれば速い


     誰に迷惑が掛かるか、という点で異なる


2010/01/22   appengine ja night #4 - @ashigeru   59
その他のパターン
  Sharding
     エンティティを複数のEGに分散
  Long Running Transaction
     リクエストをまたぐ⻑いトランザクション
  Software Global Transaction
     ソフトウェアで2PCプロトコルを実装
  Software MVCC
     ソフトウェアでMVCCを実装


2010/01/22    appengine ja night #4 - @ashigeru   60
トランザクション設計のポイント
  データの局所性を生かす
  更新頻度を意識する
  本当の制約を⾒極める




2010/01/22   appengine ja night #4 - @ashigeru   61
ポイント: データの局所性を生かす
  ユーザ情報はユーザごとに独⽴している
     同一ユーザは同時にリクエストしないことが多い
     多くのユーザを同時に捌いても並⾏稼動
  「複数のユーザが共有するリソース」に注意
     カウンタなどは典型例
     チケット予約なども該当する
  ユースケース分析は重要
     単一ユースケースの並列性から考える
     いざとなれば非正規化+Eventual Consistency


2010/01/22    appengine ja night #4 - @ashigeru   62
ポイント: 更新頻度を意識する
  更新頻度の観点でエンティティを分類
     稀に更新/常に更新のプロパティを共存させない
     更新しないプロパティはどこに混ぜてもいい
  マスタ/トランザクションデータでは不十分
     トランザクションデータも参照系と更新系に
     参照系はトランザクション処理しなくてもよい場合
     がある
  もちろん、更新に局所性があれば問題ない
     ローカルトランザクションを衝突させない設計


2010/01/22   appengine ja night #4 - @ashigeru   63
ポイント: 本当の制約を⾒極める
  Strong Consistencyはオーバースペック
  どの程度の不整合がどの順で許されるか考える
     自動販売機の支払い/商品受け取り (数秒)
     コンビニの支払い/商品受け取り (数十秒)
     ファーストフードの支払い/食事 (数分)
     レストランの支払い/食事 (▲数十分)
  同時にアプリケーション作成コストも考える
     不整合の許容は制御することが増えすぎる
     提供先のビジネス特性を考慮し、合意を得る必要性
     あらゆる観点で「必要十分」に


2010/01/22   appengine ja night #4 - @ashigeru   64

More Related Content

Recently uploaded

株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
Members_corp
 
【スポンサープラン】Marketing Native Fes 2024summer
【スポンサープラン】Marketing Native Fes 2024summer【スポンサープラン】Marketing Native Fes 2024summer
【スポンサープラン】Marketing Native Fes 2024summer
yutooyama
 
intra-mart Accel series 2024 Spring updates
intra-mart Accel series 2024 Spring updatesintra-mart Accel series 2024 Spring updates
intra-mart Accel series 2024 Spring updates
NTTDATA INTRAMART
 
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
ssuser4eac57
 
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
DAISUKE NAKAMURA
 
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
ssuserdc1268
 
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
ytakahashi4
 
kintone Café 山口 Vol.8 kintone×UiPath.pdf
kintone Café 山口 Vol.8 kintone×UiPath.pdfkintone Café 山口 Vol.8 kintone×UiPath.pdf
kintone Café 山口 Vol.8 kintone×UiPath.pdf
takashihashimoto14
 
HRMOS-saiyo_overview_material_powred_by_bizreach
HRMOS-saiyo_overview_material_powred_by_bizreachHRMOS-saiyo_overview_material_powred_by_bizreach
HRMOS-saiyo_overview_material_powred_by_bizreach
gmiki1
 
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
recruit9
 
The AI service "MMOL Pot (MMOT)" by MMOL Holdings
The AI service "MMOL Pot (MMOT)" by MMOL HoldingsThe AI service "MMOL Pot (MMOT)" by MMOL Holdings
The AI service "MMOL Pot (MMOT)" by MMOL Holdings
mikidaisuke
 

Recently uploaded (11)

株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
株式会社メンバーズ社内報MEMBUZZ(メンバズ)2024年4・5月合併号(♯168,169)
 
【スポンサープラン】Marketing Native Fes 2024summer
【スポンサープラン】Marketing Native Fes 2024summer【スポンサープラン】Marketing Native Fes 2024summer
【スポンサープラン】Marketing Native Fes 2024summer
 
intra-mart Accel series 2024 Spring updates
intra-mart Accel series 2024 Spring updatesintra-mart Accel series 2024 Spring updates
intra-mart Accel series 2024 Spring updates
 
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
研究エンパワープラットフォームを提供するLabBaseから理系採用成功に向けたご提案
 
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
株式会社ジンザイベース/特定技能外国人紹介に関する提案資料/2024ver///
 
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
株式会社ROMS採用候補者用説明資料。候補者の方向け事業概要・沿革・カルチャーをご紹介
 
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
【株式会社ゆめみ】 会社紹介 & 実績資料 ≫≫Saleshub_企業様向け≪≪
 
kintone Café 山口 Vol.8 kintone×UiPath.pdf
kintone Café 山口 Vol.8 kintone×UiPath.pdfkintone Café 山口 Vol.8 kintone×UiPath.pdf
kintone Café 山口 Vol.8 kintone×UiPath.pdf
 
HRMOS-saiyo_overview_material_powred_by_bizreach
HRMOS-saiyo_overview_material_powred_by_bizreachHRMOS-saiyo_overview_material_powred_by_bizreach
HRMOS-saiyo_overview_material_powred_by_bizreach
 
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
【公開用】株式会社VISIONARY JAPAN_エンジニアチーム 採用資料(ver2.1)
 
The AI service "MMOL Pot (MMOT)" by MMOL Holdings
The AI service "MMOL Pot (MMOT)" by MMOL HoldingsThe AI service "MMOL Pot (MMOT)" by MMOL Holdings
The AI service "MMOL Pot (MMOT)" by MMOL Holdings
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

appengine ja night #4 Transaction Puzzlers Advanced Topics

  • 2. 2種類の並⾏性制御 悲観的並⾏性制御 楽観的並⾏性制御 リソースを独占し、 リソースを独占できな 他人を待たせる かったら、やり直し 特徴 特徴 他人に迷惑をかける 他人に迷惑をかけない 成功確率が⾼い 失敗し続ける場合も 常にオーバーヘッド 成功すれば速い 誰に迷惑が掛かるか、という点で異なる 2010/01/22 appengine ja night #4 - @ashigeru 59
  • 3. その他のパターン Sharding エンティティを複数のEGに分散 Long Running Transaction リクエストをまたぐ⻑いトランザクション Software Global Transaction ソフトウェアで2PCプロトコルを実装 Software MVCC ソフトウェアでMVCCを実装 2010/01/22 appengine ja night #4 - @ashigeru 60
  • 4. トランザクション設計のポイント データの局所性を生かす 更新頻度を意識する 本当の制約を⾒極める 2010/01/22 appengine ja night #4 - @ashigeru 61
  • 5. ポイント: データの局所性を生かす ユーザ情報はユーザごとに独⽴している 同一ユーザは同時にリクエストしないことが多い 多くのユーザを同時に捌いても並⾏稼動 「複数のユーザが共有するリソース」に注意 カウンタなどは典型例 チケット予約なども該当する ユースケース分析は重要 単一ユースケースの並列性から考える いざとなれば非正規化+Eventual Consistency 2010/01/22 appengine ja night #4 - @ashigeru 62
  • 6. ポイント: 更新頻度を意識する 更新頻度の観点でエンティティを分類 稀に更新/常に更新のプロパティを共存させない 更新しないプロパティはどこに混ぜてもいい マスタ/トランザクションデータでは不十分 トランザクションデータも参照系と更新系に 参照系はトランザクション処理しなくてもよい場合 がある もちろん、更新に局所性があれば問題ない ローカルトランザクションを衝突させない設計 2010/01/22 appengine ja night #4 - @ashigeru 63
  • 7. ポイント: 本当の制約を⾒極める Strong Consistencyはオーバースペック どの程度の不整合がどの順で許されるか考える 自動販売機の支払い/商品受け取り (数秒) コンビニの支払い/商品受け取り (数十秒) ファーストフードの支払い/食事 (数分) レストランの支払い/食事 (▲数十分) 同時にアプリケーション作成コストも考える 不整合の許容は制御することが増えすぎる 提供先のビジネス特性を考慮し、合意を得る必要性 あらゆる観点で「必要十分」に 2010/01/22 appengine ja night #4 - @ashigeru 64