SlideShare una empresa de Scribd logo
1 de 27
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

Más contenido relacionado

La actualidad más candente

Azure document db
Azure document dbAzure document db
Azure document dbIan Chen
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101Ike Ellis
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - IsraelMichael Fiedler
 
Cool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBCool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBJan Hentschel
 
CosmosDb for beginners
CosmosDb for beginnersCosmosDb for beginners
CosmosDb for beginnersPhil Pursglove
 
Why MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - HabilelabsWhy MongoDB over other Databases - Habilelabs
Why MongoDB over other Databases - HabilelabsHabilelabs
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitationsBRIJESH KUMAR
 
Introduction to azure cosmos db
Introduction to azure cosmos dbIntroduction to azure cosmos db
Introduction to azure cosmos dbRatan Parai
 
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 - HabilelabsHabilelabs
 
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 nosqlRiccardo Cappello
 
Introduction à DocumentDB
Introduction à DocumentDBIntroduction à DocumentDB
Introduction à DocumentDBMSDEVMTL
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBDenny Lee
 
From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDBNuxeo
 
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
 
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 AlgoliaSaaS Is Beautiful
 

La actualidad más candente (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 a Document db

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 IntegrationBizTalk360
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101Jollen Chen
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platformgiventocode
 
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 2016Sunny 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 DiveIntergen
 
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 practicesEric 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
 
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 PlatformLuca Di Fino
 
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 RavenDBOren Eini
 
Elastic search intro-@lamper
Elastic search intro-@lamperElastic search intro-@lamper
Elastic search intro-@lampermedcl
 

Similar a 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
 

Último

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Último (20)

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

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

Notas del editor

  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