SlideShare a Scribd company logo
DocumentDB
NoSQL the sequel
Hvem er jeg?
christian@dotnetnerd.dk
www.dotnetnerd.dk
@dotnetnerd
Agenda
• Hvor passer DocumentDB ind?
• Arkitektur
• Tooling
• REST API / SDK’er
Data på Azure
• SQL
• Storage (blob, table, file, queue)
• Redis Cache
• Search
• DocumentDB
Dokumentdatabaser
• Ingen schema
• Json
• Nestede komplekse datastrukturer
• Advancerede query muligheder
• Matcher godt med objektmodeller
Hvordan adskiller DocumentDB sig?
• Bygget til cloud
• Elasticitet
• High availability
• Velkendte begreber fra SQL
• SQL
• Stored procedures
• Triggers
• User-defined functions
Ressourcer
{Json}
Property User settable or system
generated?
Purpose
_rid System generated System generated, unique
and hierarchical identifier of
the resource.
_etag System generated etag of the resource
required for optimistic
concurrency control.
_ts System generated Last updated timestamp of
the resource.
_self System generated Unique addressable URI of
the resource.
id User settable User defined unique name
of the resource.
Datatyper
• Json.NET serializer
• Datoer som ISO 8601 string
Database
Brugere og rettigheder
• Account administrators
• Read-only administrators
• Database users and permissions
• Manuelt styre adgang til resources
• All / read
var docUser = new User { Id = "mobileuser" };
docUser = await client.CreateUserAsync(database.SelfLink, docUser);
var docPermission = new Permission
{
PermissionMode = PermissionMode.Read,
ResourceLink = documentCollection.SelfLink,
Id = "readperm"
};
docPermission = await client.CreatePermissionAsync(docUser.SelfLink, docPermission);
FeedResponse<Permission> permFeed = await client.ReadPermissionFeedAsync(docUser.SelfLink);
List<Permission> permList = new List<Permission>();
foreach (Permission perm in permFeed)
{
permList.Add(perm);
}
DocumentClient userClient = new DocumentClient(new Uri(endpointUrl),permList);
Consistency levels
• Strong – quorum writes og reads. Forespørgsler er fuldt konsistente.
• Bounded Staleness – write order er konsistent. Reads må være bagud
med et specificeret antal operationer (eller tid i sekunder).
• Session - write order og reads er konsistente inden for en client
session.
• Eventual – reads må være ude af sekvens, eg., nogle reads ser
muligvis ikke de seneste ændringer
Collections
• Container til Json dokumenter
• En collection kan indeholde forskellige typer dokumenter
• Sharding og fan-out queries
• Skaleringsenhed for transaktioner og queries
• Konfigurerbar indexering
Indexing
• Automatic
• Kan slås fra (kun query på id og selflink)
• Query med FeedOptions.EnableScanInQuery
• Tilføj eller fjern enkelte dokumenter (whitelist/blacklist)
client.CreateDocumentAsync(defaultCollection.SelfLink,
new { Name = ”Christian", isSpeaking = true },
new RequestOptions
{
IndexingDirective = IndexingDirective.Include
}
);
Indexing modes
• Consistent
• Lazy (= eventual consistency level)
var defaultCollection = new DocumentCollection { Name ="defaultCollection" };
defaultCollection.IndexingPolicy.Automatic = true;
// Set IndexingMode to Lazy for bulk import/read heavy collections.
defaultCollection.IndexingPolicy.IndexingMode = IndexingMode.Lazy;
defaultCollection = await client.CreateDocumentCollectionAsync(database.SelfLink,defaultCollection);
Skalering og pris
• Capacity units
• SSD storage og throughput
Tools
• Azure Portal
• DocumentDBStudio (github)
• Visual Studio (roadmap)
• Azure DocumentDB Data
Migration Tool (github)
• Json
• MongoDB
• SQL Server
• CSV
REST API
VALUE OF THE _SELF DESCRIPTION
/dbs Feed of databases under a database account.
/dbs/{_rid-db}
Database with the unique id property with
the value {_rid-db}.
/dbs/{_rid-db}/colls/ Feed of collections under a database.
/dbs/{_rid-db}/colls/{_rid-coll}
Collection with the unique id property with
the value {_rid-coll}.
/dbs/{_rid-db}/users/ Feed of users under a database.
/dbs/{_rid-db}/users/{_rid-user}
User with the unique id property with the
value {_rid-user}.
/dbs/{_rid-db}/users/{_rid-user}/permissions Feed of permissions under a database.
/dbs/{_rid-db}/users/{_rid-
user}/permissions/{_rid-permission}
Permission with the unique id property with
the value {_rid-permission}.
POST https://mydb.documents.azure.com/dbs/XP0mAA==/colls/XP0mAJ3H-AA=/docs HTTP/1.1
x-ms-documentdb-isquery: True
x-ms-date: Mon, 18 Aug 2014 13:05:49 GMT
authorization: type%3dmaster%26ver%3d1.0%26sig%3dkOU%2bBn2vkvIlHypfE8AA5fulpn8zKjLwdrxBqyg0YGQ%3d
x-ms-version: 2014-08-21
Accept: application/json
Content-Type: application/query+json
Host: mydb.documents.azure.com
Content-Length: 50
{
query: "SELECT * FROM root WHERE (root.Person.id = 'Jens')",
parameters: []
}
SDK’er
• Dokumentation og samples:
• http://azure.microsoft.com/da-dk/documentation/services/documentdb
• https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NET-Code-6b3da8af
• .NET (Nuget)
• LINQ
• Java
• Python
• Node
• JavaScript (database)
.NET SDK
• Nuget
• Client
• Database
• Collection
• Selflinks
Performance
• Én client i applikationens levetid
• Cache selflinks
• Call client.OpenAsync()
• ConnectionMode (gateway/direct)
• Protocol (https/tcp)
new DocumentClient(new Uri(MyEndPointUrl), MyAuthorizationKey, new ConnectionPolicy()
{
ConnectionMode = ConnectionMode.Direct,
ConnectionProtocol = Protocol.Tcp
});
Queries
• SQL
• Parameters
• LINQ
• Forskellige typer i samme collection
• Ingen Skip, Top, Count…
SELECT
f.id AS familyName,
c.givenName AS childGivenName,
c.firstName AS childFirstName,
p.givenName AS petName
FROM Families f
JOIN c IN f.children
JOIN p IN c.pets
WHERE p.givenName = "King"
User-defined functions
• JavaScript
• Opret som ressource
• Brug fra Queries
var udf = new UserDefinedFunction
{
Id = "myUdf",
Body = udfBody,
};
await client.CreateUserDefinedFunctionAsync(colSelfLink, udf);
Triggers
• JavaScript
• Opret som ressource
• Specificeres ved operation
var triggerId = "myTrigger";
Trigger trigger = new Trigger
{
Id = triggerId,
Body = triggerBody,
TriggerOperation = TriggerOperation.Create,
TriggerType = TriggerType.Post //Pre or Post
};
await client.CreateTriggerAsync(colSelfLink, trigger);
var requestOptions = new RequestOptions {
PostTriggerInclude = new List<string> { triggerId }
};
await client.CreateDocumentAsync(colSelfLink, myDocument,
requestOptions);
Stored procedures
• JavaScript
• Opret som ressource
• Execute
• Tidsgrænse
await _client.CreateStoredProcedureAsync(colSelfLink,
new StoredProcedure()
{
Id = "mySproc",
Body = sprocBody
});
var sproc = _client.CreateStoredProcedureQuery(colSelfLink)
.ToList().Single(sp => sp.Id == "mySproc");
var sprocResponse =
await _client.ExecuteStoredProcedureAsync<int>(sproc.SelfLink, objData);
Transaktioner
• Dybt integrerede i javascript modellen
• Funktion = ACID transaktion med snapshot isolation
• Exception => rollback
Takeaways
• Dokumentdatabaser
• Forståelse for arkitekturen
• Overblik over tooling og sdk’er
• Mod på at bruge DocumentDB

More Related Content

What's hot

Azure document db
Azure document dbAzure document db
Azure document db
Ian Chen
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
Ike Ellis
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - Israel
Michael Fiedler
 
Cool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBCool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDB
Jan Hentschel
 
CosmosDb for beginners
CosmosDb for beginnersCosmosDb for beginners
CosmosDb for beginners
Phil Pursglove
 
Why MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - HabilelabsWhy MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - Habilelabs
Habilelabs
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitations
BRIJESH KUMAR
 
Introduction to azure cosmos db
Introduction to azure cosmos dbIntroduction to azure cosmos db
Introduction to azure cosmos db
Ratan Parai
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
Neil Mackenzie
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)
David Green
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
Habilelabs
 
Azure CosmosDb
Azure CosmosDbAzure CosmosDb
Azure CosmosDb
Marco Parenzan
 
Azure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosqlAzure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosql
Riccardo Cappello
 
NOSQL vs SQL
NOSQL vs SQLNOSQL vs SQL
NOSQL vs SQL
Mohammed Fazuluddin
 
Introduction à DocumentDB
Introduction à DocumentDBIntroduction à DocumentDB
Introduction à DocumentDB
MSDEVMTL
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
Denny Lee
 
From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDB
Nuxeo
 
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
MongoDB
 
Microsoft azure documentDB
Microsoft azure documentDBMicrosoft azure documentDB
Microsoft azure documentDB
Mohamed Elkhodary
 
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from AlgoliaSession #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
SaaS Is Beautiful
 

What's hot (20)

Azure document db
Azure document dbAzure document db
Azure document db
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - Israel
 
Cool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBCool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDB
 
CosmosDb for beginners
CosmosDb for beginnersCosmosDb for beginners
CosmosDb for beginners
 
Why MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - HabilelabsWhy MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - Habilelabs
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitations
 
Introduction to azure cosmos db
Introduction to azure cosmos dbIntroduction to azure cosmos db
Introduction to azure cosmos db
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
Azure CosmosDb
Azure CosmosDbAzure CosmosDb
Azure CosmosDb
 
Azure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosqlAzure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosql
 
NOSQL vs SQL
NOSQL vs SQLNOSQL vs SQL
NOSQL vs SQL
 
Introduction à DocumentDB
Introduction à DocumentDBIntroduction à DocumentDB
Introduction à DocumentDB
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDB
 
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
 
Microsoft azure documentDB
Microsoft azure documentDBMicrosoft azure documentDB
Microsoft azure documentDB
 
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from AlgoliaSession #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
 

Similar to Document db

Azure cosmosdb
Azure cosmosdbAzure cosmosdb
Azure cosmosdb
Udaiappa Ramachandran
 
CosmosDB.pptx
CosmosDB.pptxCosmosDB.pptx
CosmosDB.pptx
Udaiappa Ramachandran
 
Azure SQL Database
Azure SQL Database Azure SQL Database
Azure SQL Database
nj-azure
 
Azure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare IntegrationAzure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare Integration
BizTalk360
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
Jollen Chen
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platform
giventocode
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Sunny Sharma
 
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep DiveTechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
Intergen
 
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Michael Rys
 
Share point 2010 performance and capacity planning best practices
Share point 2010 performance and capacity planning best practicesShare point 2010 performance and capacity planning best practices
Share point 2010 performance and capacity planning best practices
Eric Shupps
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
Michael Collier
 
DOTNET8.pptx
DOTNET8.pptxDOTNET8.pptx
DOTNET8.pptx
Udaiappa Ramachandran
 
Accesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformAccesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data Platform
Luca Di Fino
 
An intro to Azure Data Lake
An intro to Azure Data LakeAn intro to Azure Data Lake
An intro to Azure Data Lake
Rick van den Bosch
 
mongodb_DS.pptx
mongodb_DS.pptxmongodb_DS.pptx
mongodb_DS.pptx
DavoudSalehi1
 
Elasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetupElasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetup
Eric Rodriguez (Hiring in Lex)
 
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Lessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDBLessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDB
Oren Eini
 
Mongo DB
Mongo DB Mongo DB
Elastic search intro-@lamper
Elastic search intro-@lamperElastic search intro-@lamper
Elastic search intro-@lamper
medcl
 

Similar to Document db (20)

Azure cosmosdb
Azure cosmosdbAzure cosmosdb
Azure cosmosdb
 
CosmosDB.pptx
CosmosDB.pptxCosmosDB.pptx
CosmosDB.pptx
 
Azure SQL Database
Azure SQL Database Azure SQL Database
Azure SQL Database
 
Azure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare IntegrationAzure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare Integration
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platform
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
 
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep DiveTechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
 
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
 
Share point 2010 performance and capacity planning best practices
Share point 2010 performance and capacity planning best practicesShare point 2010 performance and capacity planning best practices
Share point 2010 performance and capacity planning best practices
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
DOTNET8.pptx
DOTNET8.pptxDOTNET8.pptx
DOTNET8.pptx
 
Accesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformAccesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data Platform
 
An intro to Azure Data Lake
An intro to Azure Data LakeAn intro to Azure Data Lake
An intro to Azure Data Lake
 
mongodb_DS.pptx
mongodb_DS.pptxmongodb_DS.pptx
mongodb_DS.pptx
 
Elasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetupElasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetup
 
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
AWS CLOUD 2017 - Amazon Athena 및 Glue를 통한 빠른 데이터 질의 및 처리 기능 소개 (김상필 솔루션즈 아키텍트)
 
Lessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDBLessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDB
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Elastic search intro-@lamper
Elastic search intro-@lamperElastic search intro-@lamper
Elastic search intro-@lamper
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 

Document db

  • 3. Agenda • Hvor passer DocumentDB ind? • Arkitektur • Tooling • REST API / SDK’er
  • 4. Data på Azure • SQL • Storage (blob, table, file, queue) • Redis Cache • Search • DocumentDB
  • 5. Dokumentdatabaser • Ingen schema • Json • Nestede komplekse datastrukturer • Advancerede query muligheder • Matcher godt med objektmodeller
  • 6. Hvordan adskiller DocumentDB sig? • Bygget til cloud • Elasticitet • High availability • Velkendte begreber fra SQL • SQL • Stored procedures • Triggers • User-defined functions
  • 8. {Json} Property User settable or system generated? Purpose _rid System generated System generated, unique and hierarchical identifier of the resource. _etag System generated etag of the resource required for optimistic concurrency control. _ts System generated Last updated timestamp of the resource. _self System generated Unique addressable URI of the resource. id User settable User defined unique name of the resource.
  • 9. Datatyper • Json.NET serializer • Datoer som ISO 8601 string
  • 11. Brugere og rettigheder • Account administrators • Read-only administrators • Database users and permissions • Manuelt styre adgang til resources • All / read var docUser = new User { Id = "mobileuser" }; docUser = await client.CreateUserAsync(database.SelfLink, docUser); var docPermission = new Permission { PermissionMode = PermissionMode.Read, ResourceLink = documentCollection.SelfLink, Id = "readperm" }; docPermission = await client.CreatePermissionAsync(docUser.SelfLink, docPermission); FeedResponse<Permission> permFeed = await client.ReadPermissionFeedAsync(docUser.SelfLink); List<Permission> permList = new List<Permission>(); foreach (Permission perm in permFeed) { permList.Add(perm); } DocumentClient userClient = new DocumentClient(new Uri(endpointUrl),permList);
  • 12. Consistency levels • Strong – quorum writes og reads. Forespørgsler er fuldt konsistente. • Bounded Staleness – write order er konsistent. Reads må være bagud med et specificeret antal operationer (eller tid i sekunder). • Session - write order og reads er konsistente inden for en client session. • Eventual – reads må være ude af sekvens, eg., nogle reads ser muligvis ikke de seneste ændringer
  • 13. Collections • Container til Json dokumenter • En collection kan indeholde forskellige typer dokumenter • Sharding og fan-out queries • Skaleringsenhed for transaktioner og queries • Konfigurerbar indexering
  • 14. Indexing • Automatic • Kan slås fra (kun query på id og selflink) • Query med FeedOptions.EnableScanInQuery • Tilføj eller fjern enkelte dokumenter (whitelist/blacklist) client.CreateDocumentAsync(defaultCollection.SelfLink, new { Name = ”Christian", isSpeaking = true }, new RequestOptions { IndexingDirective = IndexingDirective.Include } );
  • 15. Indexing modes • Consistent • Lazy (= eventual consistency level) var defaultCollection = new DocumentCollection { Name ="defaultCollection" }; defaultCollection.IndexingPolicy.Automatic = true; // Set IndexingMode to Lazy for bulk import/read heavy collections. defaultCollection.IndexingPolicy.IndexingMode = IndexingMode.Lazy; defaultCollection = await client.CreateDocumentCollectionAsync(database.SelfLink,defaultCollection);
  • 16. Skalering og pris • Capacity units • SSD storage og throughput
  • 17. Tools • Azure Portal • DocumentDBStudio (github) • Visual Studio (roadmap) • Azure DocumentDB Data Migration Tool (github) • Json • MongoDB • SQL Server • CSV
  • 18. REST API VALUE OF THE _SELF DESCRIPTION /dbs Feed of databases under a database account. /dbs/{_rid-db} Database with the unique id property with the value {_rid-db}. /dbs/{_rid-db}/colls/ Feed of collections under a database. /dbs/{_rid-db}/colls/{_rid-coll} Collection with the unique id property with the value {_rid-coll}. /dbs/{_rid-db}/users/ Feed of users under a database. /dbs/{_rid-db}/users/{_rid-user} User with the unique id property with the value {_rid-user}. /dbs/{_rid-db}/users/{_rid-user}/permissions Feed of permissions under a database. /dbs/{_rid-db}/users/{_rid- user}/permissions/{_rid-permission} Permission with the unique id property with the value {_rid-permission}. POST https://mydb.documents.azure.com/dbs/XP0mAA==/colls/XP0mAJ3H-AA=/docs HTTP/1.1 x-ms-documentdb-isquery: True x-ms-date: Mon, 18 Aug 2014 13:05:49 GMT authorization: type%3dmaster%26ver%3d1.0%26sig%3dkOU%2bBn2vkvIlHypfE8AA5fulpn8zKjLwdrxBqyg0YGQ%3d x-ms-version: 2014-08-21 Accept: application/json Content-Type: application/query+json Host: mydb.documents.azure.com Content-Length: 50 { query: "SELECT * FROM root WHERE (root.Person.id = 'Jens')", parameters: [] }
  • 19. SDK’er • Dokumentation og samples: • http://azure.microsoft.com/da-dk/documentation/services/documentdb • https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NET-Code-6b3da8af • .NET (Nuget) • LINQ • Java • Python • Node • JavaScript (database)
  • 20. .NET SDK • Nuget • Client • Database • Collection • Selflinks
  • 21. Performance • Én client i applikationens levetid • Cache selflinks • Call client.OpenAsync() • ConnectionMode (gateway/direct) • Protocol (https/tcp) new DocumentClient(new Uri(MyEndPointUrl), MyAuthorizationKey, new ConnectionPolicy() { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp });
  • 22. Queries • SQL • Parameters • LINQ • Forskellige typer i samme collection • Ingen Skip, Top, Count… SELECT f.id AS familyName, c.givenName AS childGivenName, c.firstName AS childFirstName, p.givenName AS petName FROM Families f JOIN c IN f.children JOIN p IN c.pets WHERE p.givenName = "King"
  • 23. User-defined functions • JavaScript • Opret som ressource • Brug fra Queries var udf = new UserDefinedFunction { Id = "myUdf", Body = udfBody, }; await client.CreateUserDefinedFunctionAsync(colSelfLink, udf);
  • 24. Triggers • JavaScript • Opret som ressource • Specificeres ved operation var triggerId = "myTrigger"; Trigger trigger = new Trigger { Id = triggerId, Body = triggerBody, TriggerOperation = TriggerOperation.Create, TriggerType = TriggerType.Post //Pre or Post }; await client.CreateTriggerAsync(colSelfLink, trigger); var requestOptions = new RequestOptions { PostTriggerInclude = new List<string> { triggerId } }; await client.CreateDocumentAsync(colSelfLink, myDocument, requestOptions);
  • 25. Stored procedures • JavaScript • Opret som ressource • Execute • Tidsgrænse await _client.CreateStoredProcedureAsync(colSelfLink, new StoredProcedure() { Id = "mySproc", Body = sprocBody }); var sproc = _client.CreateStoredProcedureQuery(colSelfLink) .ToList().Single(sp => sp.Id == "mySproc"); var sprocResponse = await _client.ExecuteStoredProcedureAsync<int>(sproc.SelfLink, objData);
  • 26. Transaktioner • Dybt integrerede i javascript modellen • Funktion = ACID transaktion med snapshot isolation • Exception => rollback
  • 27. Takeaways • Dokumentdatabaser • Forståelse for arkitekturen • Overblik over tooling og sdk’er • Mod på at bruge DocumentDB

Editor's Notes

  1. Overvej at gemme som datoer som Epoch
  2. http://azure.microsoft.com/en-us/documentation/articles/documentdb-indexing-policies/
  3. Yderligere indextuning er muligt da man kan angive præcision
  4. http://azure.microsoft.com/en-us/documentation/articles/documentdb-indexing-policies/
  5. Authorization Signatures X-ms-date
  6. Mean stack konkurrent (Mongo, ExpressJS, Angular, Node)
  7. Gateway holder styr på routing tabel til noderne collections fordeles over Gateway bedste bud på et firmanetværk bag en firewall TCP kun i direct mode