Reindownload.microsoft.com/download/3/3/1/3314E256-7BD... · Rein relationale DB in Prod?...
Transcript of Reindownload.microsoft.com/download/3/3/1/3314E256-7BD... · Rein relationale DB in Prod?...
Rein relationale DB in Prod?
Datenbanken in produktiven Einsatz?1
SQL + NoSQL DB in Prod?
(MongoDB, Redis, CouchDB, Cassandra)2
DB-Cluster in der Cloud?3
NoSQL?!?
Come as you are
SQL Normalformen
Warum wurde DocumentDB entwickelt
Interne Nutzung und ihre Anforderungen
• Schritt halten mit dem atemberaubenden Datenzuwachs
und den wachsenden Verarbeitungsanforderungen
• Iterative Entwicklung machte Schema-Migration
kompliziert durch parallel bestehende und ständig
fortschreitende Datenmodelle
• Unsere Anwendungen wurden unnötig komplex, weil
den existierenden Dokumenten-DBs transaktional sichere
Verarbeitungs- und Abfrage-Fähigkeiten fehlten
DocumentDB innerhalb von Microsoft
Global verfügbar für alle Märkte
über 425 Millionen unique Users
speichert 20TB Daten JSON Dokumente
Speicher für 40+ App/Device Kombinationen
unter 15ms Writes und einstellige ms für Reads
user data store
msn
{"id": "AzureDocumentDB","servicetype": "Data Platform","servicename": "Azure DocumentDB","releasetype": "Preview","public": true,"regions": [
{"name": "North Europe","visible": true,"capacity": 230034
},{
"name": "West US","visible": true,"capacity": 800034
},{
"name": "East US","visible": false,"capacity": 1000034
}]
}
{"id": "employee:chgeuer","name": "Christian Geuer-Pollmann","jobrole": "Technology Evangelist","companyname": "Microsoft","photo": null,"bio": "Helps ISVs rocking on Azure","topics": [
"Cloud","Security","Development"
]}
Designed / entwickelt / optimiert – für JSON
Client SDKs
• .NET
• Python
• Node.js
• JavaScript
REST API
• Stored Data
• Indexes
Store and retrieve JSON
JavaScript is the „new T-SQL“
• Stored Procedures
• Triggers
• User-Defined Functions
Store JavaScript functions
Query via SQL
Retrieve JSON
SSD
DocumentDB
Account
/
Users
/dbs/{id}/users/{id}
Permissions
…/permissions/{id}
DocumentDocument
DocumentDocumentDocument
../colls/{id}/docs/{id}
DatabaseDatabase
Database
/dbs/{id}
AttachmentAttachment
AttachmentAttachment
../attachments/{id}
Subscription
DocumentDB Resource Model
SPROCStored
Procs
Triggers
UDFUDF
../colls/{id}/sprocs/{id}
../colls/{id}/triggers/{id}
../colls/{id}/udfs/{id}
CollectionCollectionCollection
/dbs/{id}/colls/{id}
Schema-frei und trotzdem frei abfragbar
SQL
Abfragen auf Schema-losen Daten
• Indexing Policy• Automatic
• Manual
• Indexing Mode• Consistent (synchron)
• Lazy (asynchron)
• Dokumente: Einzelne
Dokumente einschließen
oder ausschließen
• JSON Pfade:• includedPaths
• excludedPaths
Automatische Indizierung
Multi-Document Transaktionen
Collection
• Stored Procs
• Triggers
• UDF
DocumentDocumentDocuments
Database
Schnell und frei wählbare Konsistenz
Tunable Consistency Levels
Eventual: read operations always read a valid subset of writes and will eventually converge
Session: monotonic reads (you never read old data, then new, then old again), monotonic writes (writes are ordered) and that you read the most recent writes within any single client’s viewpoint.
Strong: read operations always return the value that was last written.
Bounded Staleness: reads are not “too out-of-date”. It specifically guarantees that the reads are no more than K versions older than the last written version.
Skalierbar und komplett gemanagt
DocumentDB
Account
/
Users
/dbs/{id}/users/{id}
Permissions
…/permissions/{id}
DocumentDocument
DocumentDocumentDocument
../colls/{id}/docs/{id}
DatabaseDatabase
Database
/dbs/{id}
AttachmentAttachment
AttachmentAttachment
../attachments/{id}
Subscription
DocumentDB Resource Model
SPROCStored
Procs
Triggers
UDFUDF
../colls/{id}/sprocs/{id}
../colls/{id}/triggers/{id}
../colls/{id}/udfs/{id}
CollectionCollectionCollection
/dbs/{id}/colls/{id}
DocumentDB
Account
/
Users
/dbs/{id}/users/{id}
Permissions
…/permissions/{id}
CollectionCollection
CollectionCollection
/dbs/{id}/colls/{id}
SPROCStored
Procs
Triggers
UDFUDF
../colls/{id}/sprocs/{id}
../colls/{id}/triggers/{id}
../colls/{id}/udfs/{id}DocumentDocument
DocumentDocumentDocument
../colls/{id}/docs/{id}
DatabaseDatabase
Database
/dbs/{id}
AttachmentAttachment
AttachmentAttachment
../attachments/{id}
Subscription
1..5 Capacity Units (CU)
Horizontales Skalieren über „Capacity Units“
• Eine „Capacity Unit“ (CU)
entspricht einem Shard
(Storage & Compute)
• Eine Capacity Unit bietet
Speicherplatz für bis zu 10 GB für
Dokumente
• Eine „Request Unit“ (RU) ist eine
Größe für Rechenaufwand (stored
procs, indexing, queries, user-
defined functions)
• Eine ‚volle‘ Capacity Unit (mit 10GB
JSON Daten) bietet dem Nutzer
2000 „Request Units“ (RU) pro
Sekunde
• Die RU werden dem genutzten
Speicherplatz, entsprechend
bereitgestellt, mindestens 667 RU.
• Tatsächlich aufgetretene RU in
jedem Response aufgeführt
• Throttling!! (Alerts, x-ms-retry-
after-ms)
„Capacity Units“ und „Request Units“
Entworfen und entwickelt As-A-Service
Komplett Schema-frei (JSON), aber
trotzdem frei abfragbar
Transaktionale Verarbeitung durch
integrierten JavaScript-Support
Einstellbare Konsistenz und
vorhersagbare Performance
Was ist neu an DocumentDB
Neue Webanwendungen und mobile,
Cloud-basierte Apps
Schnelle Entwicklungszyklen und hohe
Anforderungen bzgl. Skalierung
Kunden, die Key/Value-Stores nutzen
und reichhaltigere Queries und
Verarbeitung brauchen
Kunden, die Dokumenten-DBs in
Virtuellen Maschinen (IaaS) betreiben
und einen gemanagten Service suchen
Scenarios für DocumentDB
• Get started http://aka.ms/docbstart
• Learn query language http://aka.ms/docdbquery
• Download Open Source DocumentDB Studio
http://aka.ms/docdbstudio