JAZUG仙台- JAZUG4周年を祝う会in 仙台 
Introduction to DocumentDB 
2014/9/20 1.0.0 
kyrt / Takekazu Omi 
http://kyrt.in 
takekazu.omi@kyrt.in 
@takekazuomi
Azure DocumentDB 
2014/9/20 kyrt @takekazuomi 2
自己紹介 
近江武一 
JAZUG Azure Storage 担当(自称) 
Microsoft MVP for Azure 
kyrt.in 
github.com/takekazuomi 
kyrt @takekazuomi 3 
white paper 
2014/9/20
CDP Azure 本の紹介 
• Microsoft patterns & practices 
• Cloud Design Patterns: Prescriptive 
Architecture Guidance for Cloud Applications 
• http://msdn.microsoft.com/en-us/ 
library/dn568099.aspx 
• 翻訳が、2014年6月に出ました 
• クラウドデザインパターンAzureを例とし 
たクラウドアプリケーション設計の手引き 
• http://ec.nikkeibp.co.jp/item/books/P98330.html 
• 日経BP 
以下、CDP本と記述 
2014/9/20 kyrt @takekazuomi 4
Introduction to Azure 
DocumentDB 
DocumentDB入門 
2014/9/20 kyrt @takekazuomi 5
最新News 
• 8/21 preview 開始で25日目 
• New DocumentDB quotas(今朝) 
• http://blogs.msdn.com/b/documentdb/archive/2014/09/20/new-documentdb-quotas.aspx 
• Number of stored procedures, triggers and UDFs per collection 
• 5->25 each 
• Maximum request size of document and attachment 
• 16KB -> 256KB 
• Maximum number of AND/OR clauses per query 3-> 5 
• https://github.com/Azure/azure-content/ 
commit/16b49c3df1e9cccdfdaca3a669a89d287cf41c82 
2014/9/20 kyrt @takekazuomi 6
概要 
•NoSQL 
• スキーマレス 
•SQL によるクエリ 
• SSD backend 
• native JSONドキュメント 
• REST APIで操作 
• 高いスケーラビリティとパフォーマンス 
2014/9/20 kyrt @takekazuomi 7
「過去1年間にわたって、Microsoft内部で、いくつか 
の注目されているサービスに対してDocumentDB を 
使ってきました。現在では、それぞれのサイズが数 
百TBであり、1桁ミリ秒の短い待機時間の予測可能な 
パフォーマンスで、それぞれ一日あたり数百万の複 
雑なDocumentDB クエリを処理・・・・・・」 
• 引用:ScottGu’s Blog > Azure: New DocumentDB NoSQL Service, New Search Service, New SQL 
AlwaysOn VM Template, and more 
• http://weblogs.asp.net/scottgu/azure-new-documentdb-nosql-service-new-search-service-new-sql-alwayson- 
vm-template-and-more 
• http://satonaoki.wordpress.com/2014/08/25/azure-docdb-search/ 
2014/9/20 kyrt @takekazuomi 8
Microsoft Azure Data Services 
出典:http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure-DocumentDB 
2014/9/20 kyrt @takekazuomi 9
Microsoft Azure Data Services 
出典:http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure-DocumentDB 
2014/9/20 kyrt @takekazuomi 10
full managed, scalable, queryable, schemafree JSON 
document database service for modern application 
schema free 
SQL likeな簡潔な文法で階層化されたJSON dataをquery 
JavaScript expression evaluation, projections, filtering, joins 
JavaScript as a 
modern T-SQL 
collectionのstored script では、ACIDトランザクションをサポート 
JavaScriptで、procedure, UDF, trigger を記述 
tunable 
consistency 
アプリケーションのシナリオとパフォーマンス要求に応じて整 
合性を調整 
full managed VMやcluster infrastructureの管理不要 
2014/9/20 kyrt @takekazuomi 11
Resource Model 
2014/9/20 kyrt @takekazuomi 12
DEMO 
2014/9/20 kyrt @takekazuomi 13
fast, scalable, available 
2014/9/20 kyrt @takekazuomi 14
tunable consistency 
整合性の調整 
2014/9/20 kyrt @takekazuomi 15
tunable consistency levels 
• Strong 
• 強い整合性、read/writeで大きなレイテンシー、SQL 
Database と同じ 
• Bounded Staleness 
• writeは最適なレイテンシー、readで予測可能な整合性 
• Session 
• Session内ではread/writeでは最新の結果を保証 
• Eventual 
• 結果整合性、readは一時的に古いデータを返すことがあ 
る。read/write で最も低いlatency 
2014/9/20 kyrt @takekazuomi 16
前提 
•Replication の話 
• システムは複数のreplicaから構成 
• write の伝搬は時間がかかる(=lagged) 
• read でreplica を使う(=low latency, more scale) 
• Clientからの見た時の整合性 
• システム全体の整合性が失われている状態をClientに 
どう見せるか(visibility) 
2014/9/20 kyrt @takekazuomi 17
同期replication 
遅い 
じゃあ、非同期 
非整合 
2014/9/20 kyrt @takekazuomi 18
latency 
consistency 
2014/9/20 kyrt @takekazuomi 19
• replica, N=3 
• Client Aがwrite 
request 
• Client Bがread 
request 
•W rite request 
• write A ck 
• R ead request 
• read re S ponse 
2014/9/20 kyrt @takekazuomi 20
注目 
① W→ A の間の 
時間 
② Rで何処にアク 
セスするか 
WARS 
2014/9/20 kyrt @takekazuomi 21
Strong 
• 強い一貫性では、書込結果がレプリカのmajority quorum に永 
続的にコミットされた後にだけ見えるようになる 
• 書込は同期的にプライマリとセカンダリのquorum の両方に永 
続的にコミット(もしくはアボートされる) 
• 読み込みは、承認されたmajority read quorum から行われる。 
クライアントには、未コミットあるいは書込中のデータは見え 
ない。書込で最後にack が返ったものを読むことが保証される。 
• 強い整合性は、完全なデータの整合性を保証する。しかし、低 
いレベルの読み込み、書込パフォーマンス 
2014/9/20 kyrt @takekazuomi 22
Strong 
•N=3, W=2, R=2 
•2+2>3 
安全だが、latency cost が高い 
strong consistency はlatency 大きい 
2014/9/20 kyrt @takekazuomi 23
Eventual 
• Eventual consistency は、もっとも弱い一貫性 
• クライアントは一時的に以前見たものより古い値を 
見ることがある 
• それ以降の書込が無い場合は、レプリカは最終的に 
収束する 
• read request は、任意のsecondaryで処理される 
• Eventual は、weakest read consistency を提供し、 
read/writeの両方でlowest latency となる 
2014/9/20 kyrt @takekazuomi 24
Eventual 
•N=3,W=R=1 
•1+1≯ 3 
maximum possible performance 
データ喪失、read 不整合 
2014/9/20 kyrt @takekazuomi 25
新しい整合性レベル 
Session と、Bounded Staleness 
2014/9/20 kyrt @takekazuomi 26
latency 
tunable 
consistency 
2014/9/20 kyrt @takekazuomi 27
Session 
• strong やbounded staleness consistency levels が提供するようなglobal consistency 
models ではない。“session” consistency は、特定のクライアントで成立 
• 同一session内で書かれた最新の結果がread 
• read request は、client が要求したバージョン( session cookie の一部に入って 
いる)を提供できるレプリカへ発行 
• セッションの整合性に対するリード要求が(セッションクッキーの一部)は、ク 
ライアント要求されたバージョンを提供することができるレプリカに送られる 
• Session は、lowest latency writes で、予測可能なread data consistency を提供 
• ReadもReadがsingle replicaであるような特殊な場合を覗いてlow latency となる 
2014/9/20 kyrt @takekazuomi 28
•システム全体の整合性を配慮しない 
•Sessionに参加しているClient間のみの整 
合性 
•replica への伝搬初期のheavy read にパ 
フォーマンスペナルティ 
DocumentDBのデフォルト 
2014/9/20 kyrt @takekazuomi 29
Bounded Staleness 
• Bounded Staleness 整合性では書込の順番を保証するが読み込みは最大K 
操作の遅れがある 
• read request は常にreplicaのmajority quorum を返す 
• read response は、request で指定された時間内に収まるようなもっとも 
新しいものを返す 
• 低いwrite latency と、より予測可能なread consistency を提供 
• majority quorum からの読み込み応答になるので、read latency はlowest 
ではない 
• K は、operationの数(MaxStalenessPrefix)と時間(秒、 
MaxStalenessIntervalInSeconds)で指定 
2014/9/20 kyrt @takekazuomi 30
Azure Portal の設定 
2014/9/20 kyrt @takekazuomi 31
Query Consistency 
• デフォルトでは、ユーザー定義のリソースに対するクエリの整合性レ 
ベルは、読み取りの場合と同じ 
• デフォルトでは、indexは、collection のdocumentの、各insert, replace, 
deleteで、同期的に更新 
• queryは、document reads と同じ整合性レベルで実行 
• DocumentDBでは、特定のcollectionでindexの遅延更新で、write 
optimized と、documentの継続的な(だらだらとした)書込(sustained 
volumes of document writes)をサポート 
• Lazy indexing は、書込パフォーマンスをブースト 
• primarily read-heavy なワークロードでのバクルロードに最適 
2014/9/20 kyrt @takekazuomi 32
Query Consistency 
INDEXING MODE READS QUERIES 
Consistent (default) 
Strong, Bounded Staleness, Session, Eventual か 
ら選択 
Strong, Bounded Staleness, Session, 
Eventual から選択 
Lazy Strong, Bounded Staleness, Session, Eventual か 
ら選択 
Eventual 
• read request と同じように、[x-ms-consistency-level] のリ 
クエストヘッダーを指定することによって、特定のquery 
requestの整合性レベルを下げることができる 
2014/9/20 kyrt @takekazuomi 33
最後に 
2014/9/20 kyrt @takekazuomi 34
•整合性レベルに選択肢があるのは面白い 
•Sessionは普通に使えそう、Session IDの共有 
範囲、方法が課題 
•Bounded Staleness は、PBSのサイト「PBS: 
Probabilistically Bounded Staleness」がお勧め 
• http://pbs.cs.berkeley.edu/ 
•Riakがとても良い感じ 
• http://basho.com/ 
2014/9/20 kyrt @takekazuomi 35
Bookmarks 
2014/9/20 kyrt @takekazuomi 36
• ScottGu’s Blog > Azure: New DocumentDB NoSQL Service, New Search Service, New 
SQL AlwaysOn VM Template, and more 
• http://satonaoki.wordpress.com/2014/08/25/azure-docdb-search/ 
• http://weblogs.asp.net/scottgu/azure-new-documentdb-nosql-service-new-search-service-new-sql-alwayson- 
vm-template-and-more 
• Introducing Azure DocumentDB – Microsoft’s fully managed NoSQL document 
database service 
• http://blogs.msdn.com/b/documentdb/archive/2014/08/22/introducing-azure-documentdb-microsoft- 
s-fully-managed-nosql-document-database-service.aspx 
• Azure DocumentDB Team blog 
• http://blogs.msdn.com/b/documentdb/ 
• MicrosoftがMicrosoft Azure向けのドキュメントデータベースを発表 
• http://www.infoq.com/jp/news/2014/09/microsoft-azure-documentdb 
• Microsoft unveils Azure DocumentDB, a NoSQL database as a service 
• https://gigaom.com/2014/08/21/microsoft-unveils-documentdb-a-nosql-database-built-for-azure/ 
2014/9/20 kyrt @takekazuomi 37
• Introduction to Azure DocumentDB 
• http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure- 
DocumentDB 
• How to create a DocumentDB account 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ 
• Query DocumentDB 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/ 
• Consistency levels in DocumentDB 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-consistency- 
levels/ 
• DocumentDB Limits for the Preview Release 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-limits/ 
• DocumentDB programming: Stored procedures, triggers, and UDFs 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-programming/ 
2014/9/20 kyrt @takekazuomi 38
• Interact with DocumentDB Resources 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-interactions- 
with-resources/ 
• Build a web application with ASP.NET MVC using DocumentDB 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-dotnet-application/ 
• Build a Node.js web application using DocumentDB 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-nodejs-application/ 
• Manage DocumentDB capacity and performance 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-manage/ 
• Monitor a DocumentDB account 
• http://azure.microsoft.com/en-us/documentation/articles/documentdb-monitor-accounts/ 
2014/9/20 kyrt @takekazuomi 39
• Azure DocumentDB .NET Code Samples 
• http://code.msdn.microsoft.com/Azure-DocumentDB-NET-Code- 
6b3da8af 
• The Bw-Tree: A B-tree for New Hardware 
• http://research.microsoft.com/apps/pubs/default.aspx?id=178758 
• High-Performance Concurrency Control Mechanisms 
for Main-Memory Databases 
• http://research.microsoft.com/apps/pubs/default.aspx?id=156645 
• Hekaton: SQL Server ’s Memory-Optimized OLTP 
Engine 
• http://research.microsoft.com/apps/pubs/default.aspx?id=193594 
2014/9/20 kyrt @takekazuomi 40
2014/9/20 kyrt @takekazuomi 41

Introduction to DocumentDB

  • 1.
    JAZUG仙台- JAZUG4周年を祝う会in 仙台 Introduction to DocumentDB 2014/9/20 1.0.0 kyrt / Takekazu Omi http://kyrt.in takekazu.omi@kyrt.in @takekazuomi
  • 2.
    Azure DocumentDB 2014/9/20kyrt @takekazuomi 2
  • 3.
    自己紹介 近江武一 JAZUGAzure Storage 担当(自称) Microsoft MVP for Azure kyrt.in github.com/takekazuomi kyrt @takekazuomi 3 white paper 2014/9/20
  • 4.
    CDP Azure 本の紹介 • Microsoft patterns & practices • Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications • http://msdn.microsoft.com/en-us/ library/dn568099.aspx • 翻訳が、2014年6月に出ました • クラウドデザインパターンAzureを例とし たクラウドアプリケーション設計の手引き • http://ec.nikkeibp.co.jp/item/books/P98330.html • 日経BP 以下、CDP本と記述 2014/9/20 kyrt @takekazuomi 4
  • 5.
    Introduction to Azure DocumentDB DocumentDB入門 2014/9/20 kyrt @takekazuomi 5
  • 6.
    最新News • 8/21preview 開始で25日目 • New DocumentDB quotas(今朝) • http://blogs.msdn.com/b/documentdb/archive/2014/09/20/new-documentdb-quotas.aspx • Number of stored procedures, triggers and UDFs per collection • 5->25 each • Maximum request size of document and attachment • 16KB -> 256KB • Maximum number of AND/OR clauses per query 3-> 5 • https://github.com/Azure/azure-content/ commit/16b49c3df1e9cccdfdaca3a669a89d287cf41c82 2014/9/20 kyrt @takekazuomi 6
  • 7.
    概要 •NoSQL •スキーマレス •SQL によるクエリ • SSD backend • native JSONドキュメント • REST APIで操作 • 高いスケーラビリティとパフォーマンス 2014/9/20 kyrt @takekazuomi 7
  • 8.
    「過去1年間にわたって、Microsoft内部で、いくつか の注目されているサービスに対してDocumentDB を 使ってきました。現在では、それぞれのサイズが数 百TBであり、1桁ミリ秒の短い待機時間の予測可能な パフォーマンスで、それぞれ一日あたり数百万の複 雑なDocumentDB クエリを処理・・・・・・」 • 引用:ScottGu’s Blog > Azure: New DocumentDB NoSQL Service, New Search Service, New SQL AlwaysOn VM Template, and more • http://weblogs.asp.net/scottgu/azure-new-documentdb-nosql-service-new-search-service-new-sql-alwayson- vm-template-and-more • http://satonaoki.wordpress.com/2014/08/25/azure-docdb-search/ 2014/9/20 kyrt @takekazuomi 8
  • 9.
    Microsoft Azure DataServices 出典:http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure-DocumentDB 2014/9/20 kyrt @takekazuomi 9
  • 10.
    Microsoft Azure DataServices 出典:http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure-DocumentDB 2014/9/20 kyrt @takekazuomi 10
  • 11.
    full managed, scalable,queryable, schemafree JSON document database service for modern application schema free SQL likeな簡潔な文法で階層化されたJSON dataをquery JavaScript expression evaluation, projections, filtering, joins JavaScript as a modern T-SQL collectionのstored script では、ACIDトランザクションをサポート JavaScriptで、procedure, UDF, trigger を記述 tunable consistency アプリケーションのシナリオとパフォーマンス要求に応じて整 合性を調整 full managed VMやcluster infrastructureの管理不要 2014/9/20 kyrt @takekazuomi 11
  • 12.
    Resource Model 2014/9/20kyrt @takekazuomi 12
  • 13.
    DEMO 2014/9/20 kyrt@takekazuomi 13
  • 14.
    fast, scalable, available 2014/9/20 kyrt @takekazuomi 14
  • 15.
    tunable consistency 整合性の調整 2014/9/20 kyrt @takekazuomi 15
  • 16.
    tunable consistency levels • Strong • 強い整合性、read/writeで大きなレイテンシー、SQL Database と同じ • Bounded Staleness • writeは最適なレイテンシー、readで予測可能な整合性 • Session • Session内ではread/writeでは最新の結果を保証 • Eventual • 結果整合性、readは一時的に古いデータを返すことがあ る。read/write で最も低いlatency 2014/9/20 kyrt @takekazuomi 16
  • 17.
    前提 •Replication の話 • システムは複数のreplicaから構成 • write の伝搬は時間がかかる(=lagged) • read でreplica を使う(=low latency, more scale) • Clientからの見た時の整合性 • システム全体の整合性が失われている状態をClientに どう見せるか(visibility) 2014/9/20 kyrt @takekazuomi 17
  • 18.
    同期replication 遅い じゃあ、非同期 非整合 2014/9/20 kyrt @takekazuomi 18
  • 19.
    latency consistency 2014/9/20kyrt @takekazuomi 19
  • 20.
    • replica, N=3 • Client Aがwrite request • Client Bがread request •W rite request • write A ck • R ead request • read re S ponse 2014/9/20 kyrt @takekazuomi 20
  • 21.
    注目 ① W→A の間の 時間 ② Rで何処にアク セスするか WARS 2014/9/20 kyrt @takekazuomi 21
  • 22.
    Strong • 強い一貫性では、書込結果がレプリカのmajorityquorum に永 続的にコミットされた後にだけ見えるようになる • 書込は同期的にプライマリとセカンダリのquorum の両方に永 続的にコミット(もしくはアボートされる) • 読み込みは、承認されたmajority read quorum から行われる。 クライアントには、未コミットあるいは書込中のデータは見え ない。書込で最後にack が返ったものを読むことが保証される。 • 強い整合性は、完全なデータの整合性を保証する。しかし、低 いレベルの読み込み、書込パフォーマンス 2014/9/20 kyrt @takekazuomi 22
  • 23.
    Strong •N=3, W=2,R=2 •2+2>3 安全だが、latency cost が高い strong consistency はlatency 大きい 2014/9/20 kyrt @takekazuomi 23
  • 24.
    Eventual • Eventualconsistency は、もっとも弱い一貫性 • クライアントは一時的に以前見たものより古い値を 見ることがある • それ以降の書込が無い場合は、レプリカは最終的に 収束する • read request は、任意のsecondaryで処理される • Eventual は、weakest read consistency を提供し、 read/writeの両方でlowest latency となる 2014/9/20 kyrt @takekazuomi 24
  • 25.
    Eventual •N=3,W=R=1 •1+1≯3 maximum possible performance データ喪失、read 不整合 2014/9/20 kyrt @takekazuomi 25
  • 26.
    新しい整合性レベル Session と、BoundedStaleness 2014/9/20 kyrt @takekazuomi 26
  • 27.
    latency tunable consistency 2014/9/20 kyrt @takekazuomi 27
  • 28.
    Session • strongやbounded staleness consistency levels が提供するようなglobal consistency models ではない。“session” consistency は、特定のクライアントで成立 • 同一session内で書かれた最新の結果がread • read request は、client が要求したバージョン( session cookie の一部に入って いる)を提供できるレプリカへ発行 • セッションの整合性に対するリード要求が(セッションクッキーの一部)は、ク ライアント要求されたバージョンを提供することができるレプリカに送られる • Session は、lowest latency writes で、予測可能なread data consistency を提供 • ReadもReadがsingle replicaであるような特殊な場合を覗いてlow latency となる 2014/9/20 kyrt @takekazuomi 28
  • 29.
    •システム全体の整合性を配慮しない •Sessionに参加しているClient間のみの整 合性 •replica への伝搬初期のheavy read にパ フォーマンスペナルティ DocumentDBのデフォルト 2014/9/20 kyrt @takekazuomi 29
  • 30.
    Bounded Staleness •Bounded Staleness 整合性では書込の順番を保証するが読み込みは最大K 操作の遅れがある • read request は常にreplicaのmajority quorum を返す • read response は、request で指定された時間内に収まるようなもっとも 新しいものを返す • 低いwrite latency と、より予測可能なread consistency を提供 • majority quorum からの読み込み応答になるので、read latency はlowest ではない • K は、operationの数(MaxStalenessPrefix)と時間(秒、 MaxStalenessIntervalInSeconds)で指定 2014/9/20 kyrt @takekazuomi 30
  • 31.
    Azure Portal の設定 2014/9/20 kyrt @takekazuomi 31
  • 32.
    Query Consistency •デフォルトでは、ユーザー定義のリソースに対するクエリの整合性レ ベルは、読み取りの場合と同じ • デフォルトでは、indexは、collection のdocumentの、各insert, replace, deleteで、同期的に更新 • queryは、document reads と同じ整合性レベルで実行 • DocumentDBでは、特定のcollectionでindexの遅延更新で、write optimized と、documentの継続的な(だらだらとした)書込(sustained volumes of document writes)をサポート • Lazy indexing は、書込パフォーマンスをブースト • primarily read-heavy なワークロードでのバクルロードに最適 2014/9/20 kyrt @takekazuomi 32
  • 33.
    Query Consistency INDEXINGMODE READS QUERIES Consistent (default) Strong, Bounded Staleness, Session, Eventual か ら選択 Strong, Bounded Staleness, Session, Eventual から選択 Lazy Strong, Bounded Staleness, Session, Eventual か ら選択 Eventual • read request と同じように、[x-ms-consistency-level] のリ クエストヘッダーを指定することによって、特定のquery requestの整合性レベルを下げることができる 2014/9/20 kyrt @takekazuomi 33
  • 34.
    最後に 2014/9/20 kyrt@takekazuomi 34
  • 35.
    •整合性レベルに選択肢があるのは面白い •Sessionは普通に使えそう、Session IDの共有 範囲、方法が課題 •Bounded Staleness は、PBSのサイト「PBS: Probabilistically Bounded Staleness」がお勧め • http://pbs.cs.berkeley.edu/ •Riakがとても良い感じ • http://basho.com/ 2014/9/20 kyrt @takekazuomi 35
  • 36.
    Bookmarks 2014/9/20 kyrt@takekazuomi 36
  • 37.
    • ScottGu’s Blog> Azure: New DocumentDB NoSQL Service, New Search Service, New SQL AlwaysOn VM Template, and more • http://satonaoki.wordpress.com/2014/08/25/azure-docdb-search/ • http://weblogs.asp.net/scottgu/azure-new-documentdb-nosql-service-new-search-service-new-sql-alwayson- vm-template-and-more • Introducing Azure DocumentDB – Microsoft’s fully managed NoSQL document database service • http://blogs.msdn.com/b/documentdb/archive/2014/08/22/introducing-azure-documentdb-microsoft- s-fully-managed-nosql-document-database-service.aspx • Azure DocumentDB Team blog • http://blogs.msdn.com/b/documentdb/ • MicrosoftがMicrosoft Azure向けのドキュメントデータベースを発表 • http://www.infoq.com/jp/news/2014/09/microsoft-azure-documentdb • Microsoft unveils Azure DocumentDB, a NoSQL database as a service • https://gigaom.com/2014/08/21/microsoft-unveils-documentdb-a-nosql-database-built-for-azure/ 2014/9/20 kyrt @takekazuomi 37
  • 38.
    • Introduction toAzure DocumentDB • http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure- DocumentDB • How to create a DocumentDB account • http://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/ • Query DocumentDB • http://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/ • Consistency levels in DocumentDB • http://azure.microsoft.com/en-us/documentation/articles/documentdb-consistency- levels/ • DocumentDB Limits for the Preview Release • http://azure.microsoft.com/en-us/documentation/articles/documentdb-limits/ • DocumentDB programming: Stored procedures, triggers, and UDFs • http://azure.microsoft.com/en-us/documentation/articles/documentdb-programming/ 2014/9/20 kyrt @takekazuomi 38
  • 39.
    • Interact withDocumentDB Resources • http://azure.microsoft.com/en-us/documentation/articles/documentdb-interactions- with-resources/ • Build a web application with ASP.NET MVC using DocumentDB • http://azure.microsoft.com/en-us/documentation/articles/documentdb-dotnet-application/ • Build a Node.js web application using DocumentDB • http://azure.microsoft.com/en-us/documentation/articles/documentdb-nodejs-application/ • Manage DocumentDB capacity and performance • http://azure.microsoft.com/en-us/documentation/articles/documentdb-manage/ • Monitor a DocumentDB account • http://azure.microsoft.com/en-us/documentation/articles/documentdb-monitor-accounts/ 2014/9/20 kyrt @takekazuomi 39
  • 40.
    • Azure DocumentDB.NET Code Samples • http://code.msdn.microsoft.com/Azure-DocumentDB-NET-Code- 6b3da8af • The Bw-Tree: A B-tree for New Hardware • http://research.microsoft.com/apps/pubs/default.aspx?id=178758 • High-Performance Concurrency Control Mechanisms for Main-Memory Databases • http://research.microsoft.com/apps/pubs/default.aspx?id=156645 • Hekaton: SQL Server ’s Memory-Optimized OLTP Engine • http://research.microsoft.com/apps/pubs/default.aspx?id=193594 2014/9/20 kyrt @takekazuomi 40
  • 41.

Editor's Notes

  • #10 http://channel9.msdn.com/Shows/Data-Exposed/Introduction-to-Azure-DocumentDB 変更 transactionをTableまで伸ばす SQL Databaseの elastic scaleを薄める mongo ravandb casandra
  • #11 DocumentDBは、SQL DatabaseとTableの間を埋める バランスをとってる
  • #12 DocumentDB SQL Query Language http://msdn.microsoft.com/en-us/library/azure/dn782250.aspx 8:12
  • #17 バウンデッド ステルネス
  • #20 整合性を上げるためには、多くのレプリカを同期させる必要がありレイテンシーが悪化 レイテンシーを改善するには、整合性が落ちる
  • #21 こんな構成になっている
  • #22 整合性は、①と②を制御して実現する
  • #24 SQL Database とかRiakのデフォルト
  • #26 http://ria101.wordpress.com/2010/02/24/hbase-vs-cassandra-why-we-moved/
  • #28 整合性を上げるためには、多くのレプリカを同期させる必要がありレイテンシーが悪化 レイテンシーを改善するには、整合性が落ちる
  • #29 monotonic reads モノトニック読み取り一貫性(monotonic-read consistency) プロセスがデータxの値を読み込むと、同プロセスによる以降のxに対するread操作では、常に同じ値かより新しい値が読み込まれる モノトニック書き込み一貫性(monotonic-write consistency) プロセスのデータxへのwrite操作は、同プロセスによるxへのどの後続のwrite操作よりも前に完了している
  • #31 バウンデッド ステルネス http://msdn.microsoft.com/en-us/library/microsoft.azure.documents.consistencypolicy.aspx Kの条件のやつが、majority quorum になれなかったらどうなるのか? 10, 5が最小らしい
  • #32 変更は時間かかる 作成は10分ぐらい 変更もたぶん10分