Cosmic DBA Cosmos DB for SQL Server Admins and Developers

Slides:



Advertisements
Similar presentations
Chen Zhang Hans De Sterck University of Waterloo
Advertisements

NoSQL Databases: MongoDB vs Cassandra
Overview  Strong consistency  Traditional approach  Proposed approach  Implementation  Experiments 2.
Presentation by Krishna
Manage & Configure SQL Database on the Cloud Haishi Bai Technical Evangelist Microsoft.
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
Databases with Scalable capabilities Presented by Mike Trischetta.
Molecular Transactions G. Ramalingam Kapil Vaswani Rigorous Software Engineering, MSRI.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Trade-offs in Cloud.
WINDOWS AZURE STORAGE SERVICES A brief comparison and overview of storage services offered by Microsoft.
Dynamo: Amazon’s Highly Available Key-value Store DAAS – Database as a service.
NoSQL Or Peles. What is NoSQL A collection of various technologies meant to work around RDBMS limitations (mostly performance) Not much of a definition...
Travis Sansome NoSQL PaaS in Azure through DocumentDB DAT332.
Technology Drill Down: Windows Azure Platform Eric Nelson | ISV Application Architect | Microsoft UK |
Polyglot persistence with Azure data storage services. SQL Database, Azure Table Storage and Document DB June 18, 2016.
The Holmes Platform and Applications
CSCI5570 Large Scale Data Processing Systems
NO SQL for SQL DBA Dilip Nayak & Dan Hess.
and Big Data Storage Systems
Data Platform and Analytics Foundational Training
How to tune your applications before moving your database to Microsoft Azure SQL Database (MASD) OK, you've jumped into your Azure journey by creating.
Cloud Computing and Architecuture
Data Virtualization Demoette… Caching – Database – Multi Table
Introduction In the computing system (web and business applications), there are enormous data that comes out every day from the web. A large section of.
Trade-offs in Cloud Databases
Globally distributed, secure MongoDB with Azure Cosmos DB
Open Source distributed document DB for an enterprise
Let Me Finish... Isolating Write Operations
Azure Cosmos DB Venitta J Microsoft Connect /6/2018 4:36 PM
Modern Databases NoSQL and NewSQL
CMPE 280 Web UI Design and Development October 17 Class Meeting
Introduction to NewSQL
Let Me Finish... Isolating Write Operations
Russ Thomas Director, Information Services, TSYS
1 Demand of your DB is changing Presented By: Ashwani Kumar
Arrested by the CAP Handling Data in Distributed Systems
11/18/2018 2:14 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Let's make a complex dataset simple using Azure Cosmos DB
Ewen Cheslack-Postava
Transactions, Locking and Query Optimisation
Explore the Azure Cosmos DB with .NET Core 2.0
Power-up NoSQL with Azure Cosmos DB
Cloud Data Replication with SQL Data Sync
Understanding Transaction Isolation Levels
Let Me Finish... Isolating Write Operations
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Azure Cosmos DB What you need to know & concepts
Let's make a complex dataset simple using Azure Cosmos DB
Let Me Finish... Isolating Write Operations
Transaction Properties: ACID vs. BASE
Azure Cosmos DB with SQL API .Net SDK
Distributed Database Management Systems
CMPE 280 Web UI Design and Development March 14 Class Meeting
04 | Performance and the Premium SKU
Hello My Friends, Welcome to CosmosDB
Server-Side Programming
Resource Model.
Request Units & Billing
Global Distribution.
Azure Data Storage Options
Introduction To DocumentDB
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Developing Cosmos DB for the Enterprise
ZORAN BARAC DATA ARCHITECT at CIN7
Developer Intro to Cosmos DB
Hello My Friends, Welcome to CosmosDB
The Database World of Azure
Azure Cosmos DB – FY20 Top Use Cases
Presentation transcript:

Cosmic DBA Cosmos DB for SQL Server Admins and Developers Mike Donnelly, Database Person

Mike Donnelly Worked with SQL Server for about fifteen years Database Person, He/Him I Lived in Tokyo for four years / 東京に四年住んでいました /melsar93 @sqlmd

Overview What is Cosmos DB Why did my project decide to switch from SQL to NoSQL with Cosmos Things DBAs care about

What is Cosmos DB?

Azure Cosmos DB is Microsoft’s proprietary globally-distributed, multi-model database service "for managing data at planet-scale" launched in May 2017. It is schema-agnostic, horizontally scalable and generally classified as a NoSQL database.

Cosmos DB is Horizontally Partitioned Distributed Globally Built for the Cloud Using Replica Sets to scale Horizontally Redundancy is built in Cosmos only runs on Azure there is no on Prem version

APIs Supported Table API SQL (Non-Relational)

Why Cosmos DB?

Cosmos DB Because Distributed Globally Building in the Cloud Lots of Serialization / Deserialization of JSON Distributed Globally Building in the Cloud

Creating a Document Container

Mind Shift to NoSQL New things to think about : Partition Keys Consistency Indexing Documents Request Units

Partitioning is Key Picking the right Partition Key is probably the most important first step when using Cosmos DB Logical vs. Physical 10GB Limit on Logical Wide Range of Values

Consistency Levels Strong Bounded Staleness Session Consistent Prefix Eventual Strong With strong consistency, you are guaranteed to always read the latest version of an item similar to read committed isolation in SQL Server. You can only ever see data which is durably committed. Strong consistency is scoped to a single region. Bounded-staleness In bounded-staleness consistency read will lag behind writes, and guarantees global order and not scoped to a single region. When configuring bounded-staleness consistency you need to specify the maximum lag by: Operations For a single region the maximum operations lag must be between 10 and 1 000 000, and for the multi region, it will be between 100 000 and 1 000 000. Time The maximum lag must be between 5 seconds and 1 day for either single or multi-regions. Session This is the most popular consistency level, since it provides consistency guarantees but also has better throughput. Consistent Prefix A global order is preserved, and prefix order is guaranteed. A user will never see writes in a different order than that is which it was written. Eventual Basically, this is like asynchronous synchronization. It guarantees that all changes will be replicated eventually, and as such, it also has the lowest latency because it does not need to wait on any commits.

Indexing still matters Everything is indexed by default Add custom indexing if it makes sense { "id": "1", "locationId": "999", "questions": [ "questionText": "Did you do it yet?", "responses": [ "yes", "no" ] }, "quest

What RU? Request Units are the DTU of Cosmos DB 1 RU corresponds to the throughput of a read of a 1 KB document. Database level or container level

RU Considering the Right Things? Item Size Indexing/property count Query Pattern/Scripts “Don’t calculate, measure.” - Ricardo Niepel'

A Closer Look

CosmosDBA Converting the Schema It’s Not Really SQL Transactions Time to Live Stored Procedures and Triggers

Schema-less is a Myth Determine how the Data Should be modeled Decide on Embedded Data vs Reference Key https://docs.microsoft.com/en-us/azure/cosmos-db/modeling-data Typically denormalized data models provide better read performance.

Relational Model

NoSQL or JSON model

Cosmic Karma

The SQL API is not all there SELECT * FROM a where a.locationId = “999” SELECT a.questions FROM a SELECT * FROM q in a.questions

Let’s Look at some “SQL” queries

Transactions in Cosmos Not really transactions, but at the Partition Key level Use Stored Procedures to handle multi-document actions Use triggers to enforce some relationships

function createTwoDocuments(locationName, industry, billRate) { var context = getContext(); var collection = context.getCollection(); var firstDocument = { location: locationName, industry: industry }; var secondDocument = { billing: { discounted: false, rate: billRate } var firstAccepted = collection.createDocument(collection.getSelfLink(), firstDocument, function (firstError, newFirstDocument) { if (firstError) throw new Error('Error' + firstError.message); var secondAccepted = collection.createDocument(collection.getSelfLink(), secondDocument, function (secondError, newSecondDocument) { if (secondError) throw new Error('Error' + secondError.message); context.getResponse().setBody({ locationRecord: newFirstDocument, billingRecord: newSecondDocument }); ); if (!secondAccepted) return; if (!firstAccepted) return; Example Stored Proc

https://azurecosmosdb.github.io/CosmicNotes/ Any Questions? @AzureCosmosDB https://azurecosmosdb.github.io/CosmicNotes/

Mike Donnelly @sqlmd sqldonnelly@gmail.com