Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cosmos DB Consistency Levels and Introduction of TLA+

587 views

Published on

dotNET600 2018 Center CLRで、CosmosDB Consistency Levels の説明と、仕様がTLA+で公開されていること。続いて、TLA+の紹介のデモをしたときの資料。

動画が公開されています。
https://youtu.be/ldRFhFEdbp8?t=240

Published in: Technology
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THI5 BOOKS 1NTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Cosmos DB Consistency Levels and Introduction of TLA+

  1. 1. Azure Cosmos DBの Consistency levels Takekazu Omi takekazu.omi@kyrt.in 2018/11/24 R.1.0 dotNET600 2018 Center CLR
  2. 2. kyrt @takekazuomi 22018/11/24
  3. 3. 自己紹介 近江 武一 Microsoft MVP for Azure http://www.slideshare.net/takekazuomi kyrt @takekazuomi 3 kyrt.in github.com/takekazuomi white paper 監訳 2018/11/24 Tech Summit 2018 http://bit.ly/2zoKPsA
  4. 4. What is Azure CososDB? Azure Cosmos DB とは何か? 2018/11/24 kyrt @takekazuomi 4
  5. 5. kyrt @takekazuomi 52018/11/24
  6. 6. tunable consistency 整合性の調整 2018/11/24 kyrt @takekazuomi 6
  7. 7. 前提 Replication  システムは複数のreplicaから構成  write の伝搬は時間がかかる (=lagged)  read でreplica を使う (=low latency, more scale) Clientからの見た時の整合性  システム全体の整合性が失われている状態をClient にどう見せるか(visibility) kyrt @takekazuomi 72018/11/24
  8. 8. 同期 replication 遅い じゃあ、非同期 不整合 kyrt @takekazuomi 8 2018/11/24
  9. 9. Distributed databases 可用性=レプリケーション スケーラビリティー=パーティショニング トレードオフ 読取整合性、可用性、待機時間、スループット kyrt @takekazuomi 92018/11/24
  10. 10. トレードオフ kyrt @takekazuomi 102018/11/24 latency consistency
  11. 11. kyrt @takekazuomi 112018/11/24
  12. 12. 5つの整合性レベル strong, bounded staleness, session, consistent prefix, eventual kyrt @takekazuomi 122018/11/24
  13. 13. Eventual Eventual consistency は、もっとも弱い一貫性 読込データが最新である保証は無い 読み取り順序の保証がなく、クライアントは一時 的に以前見たものより古い値を見ることがある それ以降の書込が無い場合は、レプリカは最終 的に収束する kyrt @takekazuomi 132018/11/24
  14. 14. Consistent prefix 返される更新には、それ以外の全更新の一 部のプレフィックスが含まれる(ギャップなし)  また、読み取りでは決して順不同の書き込み が確認されないことが保証 A: 1、B: 2、A: 3、B: 6、A: 5、B:7 の順で書いたと き、A:3、B:7が読まれることは無い kyrt @takekazuomi 142018/11/24
  15. 15. Session 読み取りでは、Consistent Prefix Monotonic Read: 読み込めるデータは先祖返り しない Monotonic Write: 書込順序は保存 Read Your own Write(RYW): 自分で書いたも のは最新が読める セッション整合性は、クライアント セッション kyrt @takekazuomi 152018/11/24
  16. 16. Bounded staleness  書き込み後、 一時的に一貫性の低下期間(staleness window)がある。  staleness window での読み取りは、 consistent-prefixを 保証  staleness window、最大T時間、あるいは最大K操作で指 定  strong は、staleness window=0な、 Bounded staleness と同じ(=time-delayed linearizability)  書き込みと同一リージョン内はstrongと同じ kyrt @takekazuomi 162018/11/24
  17. 17. Strong いわゆる、Linearizable 書き込まれたデータは、どのプロセス絡みて も常に最新の値が見える グローバルレプリケーション不可 kyrt @takekazuomi 172018/11/24 https://aphyr.com/posts/313-strong-consistency-models
  18. 18. 参考 Azure Cosmos DBで導入されたBounded StalenessはProbabilistic Quorumで実現で きるらしい https://qiita.com/everpeace/items/cbbace418f 7bc297631f kyrt @takekazuomi 182018/11/24
  19. 19. 結局どういう動きなのか、 さっぱりわからん コード書いて動かしてみても、 わかるのか kyrt @takekazuomi 192018/11/24
  20. 20. そもそも、ずいぶん複雑だけど これ本当にうごいているの ? kyrt @takekazuomi 202018/11/24 分散システムはBUGの温床 orz…..
  21. 21. kyrt @takekazuomi 212018/11/24
  22. 22. kyrt @takekazuomi 222018/11/24 ツマラナイ….. 600 っぽくない
  23. 23. 仕様は、TLA+ のを公開するんで 見てね by Microsoft kyrt @takekazuomi 232018/11/24 https://docs.microsoft.com/ja-jp/azure/cosmos-db/consistency-levels
  24. 24. TLA+ specifications for Cosmos DB https://github.com/Azure/azure-cosmos-tla kyrt @takekazuomi 242018/11/24
  25. 25. formal methods/形式手法 kyrt @takekazuomi 252018/11/24
  26. 26. プログラミングの問題 結局の所コードを書いて動かしてみないと正し く動くかどうか検証できない。これだと、動かし たところしか検証できない ↓ これだと、詳細すぎる ↓ 仕様を書いて検証できれば、、、 kyrt @takekazuomi 262018/11/24
  27. 27. Azure Cosmos DB 「Azure Cosmos DB’s design and implementation for precisely specifying a set of relaxed yet well-defined consistency models with TLA+.」  Cosmos DBは設計と実装に、TLA+で厳格に定義さ れた複数の整合性緩和モデルを利用  https://azure.microsoft.com/en-us/blog/a- technical-overview-of-azure-cosmos-db/ kyrt @takekazuomi 272018/11/24
  28. 28. その他の利用例 XBox メモリ システム BUG  https://channel9.msdn.com/Events/Build/2014/3- 642#time=21m46s AWSでの利用  How Amazon Web Services Uses Formal Methods  Why Amazon Chose TLA+  http://lamport.azurewebsites.net/tla/amazon.html kyrt @takekazuomi 282018/11/24
  29. 29. TLA+ formal methods/形式手法 2018/11/24 kyrt @takekazuomi 29 https://en.wikipedia.org/wiki/TLA%2B
  30. 30. TLA+  TLA+  仕様記述言語  PlusCal  algorithm language  TLA+ Toolbox.  https://github.com/tlapl us/tlaplus kyrt @takekazuomi 302018/11/24 http://lamport.azurewebsites.net/tla/tla.html
  31. 31. Demo kyrt @takekazuomi 312018/11/24 デモの内容は、下記サイトを元にしています。 https://learntla.com/introduction/
  32. 32. 付録 2018/11/24 kyrt @takekazuomi 32
  33. 33.  Dr. TLA+ Series - Raft  https://www.youtube.com/watch?v=6Kwx8zfGW0Y  The Raft Consensus Algorithm  https://raft.github.io/  形式手法 (Formal Methods) についての調査  http://d.hatena.ne.jp/sakaia/20150418  Use of Formal Methods at Amazon Web Services  http://lamport.azurewebsites.net/tla/amazon.html  The Evolution of Testing Methodology at AWS: From Status Quo to Formal Methods with TLA+  https://www.infoq.com/presentations/aws-testing-tla  TLA+  https://github.com/tlaplus  Exploring TLA+ with two-phase commit  http://brooker.co.za/blog/2013/01/20/two-phase.html kyrt @takekazuomi 332018/11/24
  34. 34.  Learn TLA+  https://learntla.com/introduction/  形式手法(Formal Methods)  https://tnanjo.net/formal-methods/  TLA+ 入門  https://tnanjo.net/tla-plus-getting-started/  Azure #CosmosDB @ Build 2018: 次世代アプリの推進基盤  https://blogs.technet.microsoft.com/jpitpro/2018/05/22/azure-cosmosdb- build-2018-the-catalyst-for-next-generation-apps/  TLA+ Wikipedia  https://en.wikipedia.org/wiki/TLA%2B#cite_note-awschose-23  Thinking for Programmers  https://channel9.msdn.com/Events/Build/2014/3-642#time=21m46s kyrt @takekazuomi 342018/11/24
  35. 35. kyrt @takekazuomi 352018/11/24 終

×