Developer Intro to Cosmos DB

Slides:



Advertisements
Similar presentations
Inner Architecture of a Social Networking System Petr Kunc, Jaroslav Škrabálek, Tomáš Pitner.
Advertisements

DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Creating a SharePoint App with Microsoft Access Services
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
itcamp12 # Premium conference on Microsoft technologies Serving 10 million requests per day How to solve the architecture challenges of a high.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
ITGS Databases.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Copyright © New Signature Who we are: Focused on consistently delivering great customer experiences. What we do: We help you transform your business.
Exploring Networked Data and Data Stores Lesson 3.
In a Document-Oriented NoSQL Database { "name": "Andrew Liu", " ": "twitter": }
COMP 430 Intro. to Database Systems MongoDB. What is MongoDB? “Humongous” DB NoSQL, no schemas DB Lots of similarities with SQL RDBMs, but with more flexibility.
Bret Stateham Owner, Net Connex blogs.netconnex.com twitter.com\bstateham.
Polyglot persistence with Azure data storage services. SQL Database, Azure Table Storage and Document DB June 18, 2016.
DevOps with ASP.NET Core and Entity Framework Core
1/27/2018 5:13 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
NO SQL for SQL DBA Dilip Nayak & Dan Hess.
Denis Reznik Data Architect, Intapp, Inc. Microsoft Data Platform MVP
Working with Logic App Cloud Adapters, Functions, and Storage
Application area Events Conferences Exhibitions
Partner Toolbox Cloud Infrastructure & Management
Scalable Web Apps Target this solution to brand leaders responsible for customer engagement and roll-out of global marketing campaigns. Implement scenarios.
Accelerate your DevOps with OpenShift by Red Hat
Embed Power BI in your Web application
Data-driven serverless apps with Azure functions
Microsoft /2/2018 3:42 PM BRK3129 Query Big Data using the Expanded T-SQL footprint with PolyBase in SQL Server 2016 Casey Karst Program Manager.
Automate Custom Solutions Deployment on Office 365 and Azure
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Globally distributed, secure MongoDB with Azure Cosmos DB
Open Source distributed document DB for an enterprise
Beyond the BDC\BCS Model
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Developing Hybrid Apps on Microsoft Azure Stack
Elastic database patterns for SaaS applications in Azure
Azure Cosmos DB Venitta J Microsoft Connect /6/2018 4:36 PM
7/18/2018 8:55 PM Migracija IoT rešenja na Azure PaaS model ili: Kako sam prestao da brinem o IT infrastrukturi i zavoleo Azure Nebojša Stojanović © Microsoft.
7/19/2018 9:40 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Couchbase Server is a NoSQL Database with a SQL-Based Query Language
Master Modern PaaS for the Enterprise with Azure App Service
Get Started with Common Data Model (CDM) and PowerApps
Scalable Web Apps Target this solution to brand leaders responsible for customer engagement and roll-out of global marketing campaigns. Implement scenarios.
Twitter & NoSQL Integration with MVC4 Web API
Building Scalable Serverless Apps in the Cloud: AWS or Azure ?
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
Teaching slides Chapter 8.
Developing for the cloud with Visual Studio
Explore the Azure Cosmos DB with .NET Core 2.0
Power-up NoSQL with Azure Cosmos DB
Site scripts and Site Design
Serverless Architecture in the Cloud
Let's make a complex dataset simple using Azure Cosmos DB
Integrating REST API and SQL Server JSON Functions
Azure Cosmos DB with SQL API .Net SDK
MS AZURE By Sauras Pandey.
Sayed Ibrahim Hashimi Program Manager Microsoft Corporation
5 Azure Services Every .NET Developer Needs to Know
Intro to Machine Learning (And Azure)
Data Modeling.
Request Units & Billing
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Office 365 Development July 2014.
Windows Forms in Visual Studio 2005: An in-depth look at key features
9/8/ :03 PM © 2006 Microsoft Corporation. All rights reserved.
Michael Stephenson Microsoft MVP - Azure
Alex Karcher 5 tips for production ready Azure Functions
Cosmic DBA Cosmos DB for SQL Server Admins and Developers
Azure Cosmos DB – FY20 Top Use Cases
Presentation transcript:

Developer Intro to Cosmos DB

About Me Brandon Brockhoeft BIO Brandon is a career software engineer working primarily with Microsoft solutions with over 15 years of professional experience. He has provided development and architecture technology solutions in the finance, state government, energy, and aerospace industries. His functional expertise includes: full-stack development, distributed architecture, real-time communication, DevOps and agile transformation, & mentoring. Brandon Brockhoeft Principal Consultant @bbrockhoeft22 brandon-brockhoeft-55777a1

What is Cosmos DB? Globally distributed, multi-model DB Azure service Schema-less (Code is the schema!) Transparently replicates data Multi-master writes Consistency choices Automatic indexing SQL and NoSQL APIs Changefeed (CEP)

DB Usage Comparison Cosmos DB SQL Server Scale Horizontal Vertical Data Geo-Distributed / Eventual Consistency Integrity and Consistency Focused Cost Throughput and Storage-based CPU-based Tooling Microsoft and Dev Community Microsoft and Commercial Products

Cosmos DB Setup Containers and Partitions Partition Keys Request units: item size, indexing, property count, consistency, query patterns RU/s = $ Cost Insufficient funds = throttled requests

Indexing Cosmos DB automatically indexes every property for all items in your container Indexing done synchronously when data is written Indexes are written as trees used to map to property paths: /locations/1/country: "France" Customize indexing by setting its indexing mode & include/exclude property paths Order by multiple properties requires custom composite indexes Index transformation done online and in-place: impacts query consistency

Tools Cosmos DB Data Migration Tool Build / Download: https://github.com/azure/azure-documentdb-datamigrationtool Documentation: https://docs.microsoft.com/en-us/azure/cosmos-db/import-data Manage and automate Cosmos DB resources: PowerShell Azure CLI Azure Resource Manager templates Work with data (using SQL) Cosmos DB Playground: https://aka.ms/cosmos-db-playground Document Explorer - Azure or Local Emulator

Data Modeling Code-first at all times Performing w/o a net: little constraints, no cascading, few DB types, no sizes, or defaults Have well-defined and tested validation patterns Mistakes not as easily corrected* (as SQL Server) Self-joins only in SQL API Unique key constraints only within partition Implies document ID is not the partition ID Can be single property or composite key Cannot be changed; requires new container + data migration Modeling techniques: Embed data (denormalized) Reference data (normalized) Hybrid

Data Modeling - Embed All within one JSON document - allows single read/write Duplication of data is okay Typically better read performance Useful when: Contained relationships between entities One-to-few relationships between entities Embedded data that changes infrequently Embedded data that will not grow without bound Embedded data that is queried frequently together { "id": "1", "firstName": "Thomas", "lastName": "Andersen", "addresses": [ "line1": "100 Some Street", "line2": "Unit 1", "city": "Seattle", "state": "WA", "zip": 98012 } ], "contactDetails": [ {"email": "thomas@andersen.com"}, {"phone": "+1 555 555-5555"} ]

Data Modeling - Reference No foreign-keys / weak links only Requires multiple database trips Don’t create join containers Typically better write performance Consider data growth for relationship Useful when: Representing one-to-many relationships Representing many-to-many relationships Related data changes frequently Referenced data could be unbounded Author documents: {"id": "a1", "name": "Thomas Andersen", "books": ["b1, "b2", "b3"]} {"id": "a2", "name": "William Wakefield", "books": ["b1", "b4"]} Book documents: {"id": "b1", "name": "Azure Cosmos DB 101", "authors": ["a1", "a2"]} {"id": "b2", "name": "Azure Cosmos DB for RDBMS Users", "authors": ["a1"]} {"id": "b3", "name": "Learn about Azure Cosmos DB", "authors": ["a1"]} {"id": "b4", "name": "Deep Dive into Azure Cosmos DB", "authors": ["a2"]}

Data Modeling - Hybrid Author documents: Book documents: { "id": "a1", "firstName": "Thomas", "lastName": "Andersen", "countOfBooks": 3, "books": ["b1", "b2", "b3"], "images": [ {"thumbnail": "https://....png"} {"profile": "https://....png"} {"large": "https://....png"} ] }, "id": "a2", "firstName": "William", "lastName": "Wakefield", "countOfBooks": 1, "books": ["b1"], } Book documents: { "id": "b1", "name": "Azure Cosmos DB 101", "authors": [ {"id": "a1", "name": "Thomas Andersen", "thumbnailUrl": "https://....png"}, {"id": "a2", "name": "William Wakefield", "thumbnailUrl": "https://....png"} ] }, "id": "b2", "name": "Azure Cosmos DB for RDBMS Users", {"id": "a1", "name": "Thomas Andersen", "thumbnailUrl": "https://....png"}, }

Sample Azure Data Explorer SQL Query examples - see CosmosDemo/CustomerContact/docs/SQL_Samples.md Customer Contact Demo application with C# SDK (v3) ASP.NET sample app with form data

More Info Conference video on Cosmos DB by Jimmy Bogard https://headspring.com/2018/05/30/video-from-sql-to-azure-cosmos-db/ Microsoft documentation (Used for presentation content) https://docs.microsoft.com/en-us/azure/cosmos-db/ Microsoft dotnet SDK reference https://docs.microsoft.com/en-us/dotnet/api/overview/azure/cosmosdb?view=azure-dotnet Query cheat sheets https://docs.microsoft.com/en-us/azure/cosmos-db/query-cheat-sheet

Session Evaluations Session Evaluations are ONLINE ONLY. Your feedback is valuable! SQLSatBR.com/Sessions/SessionEvaluation.aspx

Changefeed Event Driven Architecture by default Lambda Architecture with low TCO Use Azure Functions without infrastructure concerns Observe container changes sorted within partition key Consumer parallel processing available by partition key Use soft markers for data operation filtering (insert/update/delete) Consider use of TTL and start time options

Data Modeling - Mixed Types Book and Review documents in one container: { "id": "b1", "name": "Azure Cosmos DB 101", "bookId": "b1", "type": "book" }, "id": "r1", "content": "This book is awesome", "type": "review" "id": "r2", "content": "Best book ever!", }