The Hitchhikers Guide to the Cosmos Chad Green D e v S p a c e - - PowerPoint PPT Presentation

the hitchhiker s guide to the cosmos
SMART_READER_LITE
LIVE PREVIEW

The Hitchhikers Guide to the Cosmos Chad Green D e v S p a c e - - PowerPoint PPT Presentation

The Hitchhikers Guide to the Cosmos Chad Green D e v S p a c e O c t o b e r 1 2 , 2 0 1 9 @chadgreen @chadgreen DevSpace would like to thank our sponsors Who is Chad Green D irec tor of S of t ware D evelop ment S c h olarR x


slide-1
SLIDE 1

@chadgreen @chadgreen

The Hitchhiker’s Guide to the Cosmos

Chad Green

D e v S p a c e O c t o b e r 1 2 , 2 0 1 9

slide-2
SLIDE 2

DevSpace would like to thank our sponsors

slide-3
SLIDE 3

@chadgreen @chadgreen

Who is Chad Green

D irec tor of S of t ware D evelop ment S c h olarR x

 chadgreen@chadgreen.com  chadgreen.com  ChadGreen  ChadwickEGreen

slide-4
SLIDE 4

@chadgreen @chadgreen

What is Cosmos DB

slide-5
SLIDE 5

@chadgreen @chadgreen

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

Turnkey global distribution

slide-6
SLIDE 6

@chadgreen @chadgreen

Comprehe hensive SLAs

Turnkey global distribution

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

Turnke nkey glo globa bal dis distrib ibutio ion

slide-7
SLIDE 7

@chadgreen @chadgreen

Turnkey global distribution

Ela lastic ic s scale le o

  • ut
  • f s

f storage ge & t thr hroughp ghput

Comprehensive SLAs

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

Comprehe hensive SLAs

slide-8
SLIDE 8

@chadgreen @chadgreen

Turnkey global distribution Elastic scale out

  • f storage & throughput

Comprehensive SLAs

Gu Guaranteed lo ed low w la latenc ency at th at the 9 99th

th per

percentile ile

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

Ela lastic ic s scale le o

  • ut
  • f s

f storage ge & t thr hroughp ghput

slide-9
SLIDE 9

@chadgreen @chadgreen

Turnkey global distribution Elastic scale out

  • f storage & throughput

Comprehensive SLAs

Gu Guaranteed lo ed low w la latenc ency at th at the 9 99th

th per

percentile ile

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

Guaranteed low latency at the 99th percentile

Fiv Five well well-define ned cons nsistenc ncy m models dels

slide-10
SLIDE 10

@chadgreen @chadgreen

Event ntual Sessi ssion St Strong Consiste tent P Prefix Bounded S ded Stal alen enes ess

Turnkey global distribution Elastic scale out

  • f storage & throughput

Five well-defined consistency models Comprehensive SLAs Guaranteed low latency at the 99th percentile

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

slide-11
SLIDE 11

@chadgreen @chadgreen

No schema o a or index ex m managem agemen ent Battle e tested ed databas abase e service Ubiquitou

  • us r

regional presence Secure by default and enterprise ready

Turnkey global distribution Elastic scale out

  • f storage & throughput

Five well-defined consistency models Comprehensive SLAs Guaranteed low latency at the 99th percentile

A globally distributed, massively scalable, multi-model database service

Azure Cosmos DB

slide-12
SLIDE 12

@chadgreen @chadgreen

Azure Cosmos DB Request Units

  • Item Size
  • Item Indexing
  • Item Property Count
  • Indexed Properties
  • Data Consistency
  • Query Patterns
  • Script Usage
slide-13
SLIDE 13

@chadgreen @chadgreen

Azure Cosmos DB Pricing

Unit Price Provisioned Throughput (multiple region writes) per 100 RU/s $0.016/hour Provisioned Throughput (single region writes) per 100 RU/s $0.008/hour SSD Storage (per GB) $0.25 GB/month Starts at approximately $23.61/month Save 15-65% with Reserved Pricing

slide-14
SLIDE 14

@chadgreen @chadgreen

Azure Cosmos Capabilities

What if we have REALY large data requirements?

slide-15
SLIDE 15

@chadgreen @chadgreen

Azure Cosmos Capabilities

Resource Default Limit Maximum RUs per container 1,000,000 Maximum RUs per database 1,000,000 Maximum Rus per (logical) partition key 10,000 Maximum storage across all items per (logical) partition key 10 GB Maximum number of distinct (logical) partition keys Unlimited Maximum storage per container Unlimited Maximum storage per database Unlimited

slide-16
SLIDE 16

@chadgreen @chadgreen

Cosmos Use Cases

slide-17
SLIDE 17

@chadgreen @chadgreen

IoT and Telematics

Common Pattern in IoT use cases

  • Ingest bursts of data from devices and sensors of various locales
  • Process and analyze streaming data to derive real-time insights
  • Archive data to cold storage for batch analytics
slide-18
SLIDE 18

@chadgreen @chadgreen

IoT and Telematics

slide-19
SLIDE 19

@chadgreen @chadgreen

Retail and Marketing

  • Used extensively by Microsoft’s own e-commerce platforms
  • Storing and querying a set of attributes for entities
  • Examples of catalog data
  • User Accounts
  • Product Catalogs
  • IoT Device Registries
slide-20
SLIDE 20

@chadgreen @chadgreen

Retail and Marketing

slide-21
SLIDE 21

@chadgreen @chadgreen

Retail and Marketing

slide-22
SLIDE 22

@chadgreen @chadgreen

Gaming

  • Database tier is crucial
  • Often require single-millisecond latencies for reads and writes
  • Needs to be fast and able to handle massive spikes
slide-23
SLIDE 23

@chadgreen @chadgreen

Gaming

slide-24
SLIDE 24

@chadgreen @chadgreen

Web & Mobile Applications

  • Modeling social interactions
  • Integrating with third-party services
  • Building rich personalized experiences
slide-25
SLIDE 25

@chadgreen @chadgreen

Web & Mobile Applications – Social Applications

slide-26
SLIDE 26

@chadgreen @chadgreen

Web & Mobile Applications – Personalization

slide-27
SLIDE 27

@chadgreen @chadgreen

Integrations

slide-28
SLIDE 28

@chadgreen @chadgreen

Cosmos DB Integrations

Apache Spark Etch API Change Feed Azure Functions Azure Logic Apps Microsoft Flow

slide-29
SLIDE 29

@chadgreen @chadgreen

Navigating the 5 API Models

slide-30
SLIDE 30

@chadgreen @chadgreen

Resource Model and API Projections

Atom Resource Sequence

slide-31
SLIDE 31

@chadgreen @chadgreen

SQL API

Document Database

slide-32
SLIDE 32

@chadgreen @chadgreen

SQL API – What

  • Document Database
  • Originally Microsoft’s DocumentDB implementation
  • Supports using SQL as a JSON query language
  • Uses JavaScript’s programming model as foundation for query language
slide-33
SLIDE 33

@chadgreen @chadgreen

SQL API – Why

Building a new non-relational document database and want to query using SQL

slide-34
SLIDE 34

@chadgreen @chadgreen

SQL API – How: Data Model

SELECT * FROM c WHERE c.OwnerEmailAddress = ‘chadgreen@chadgreen.com’

slide-35
SLIDE 35

@chadgreen @chadgreen

SQL API – How: Insert

slide-36
SLIDE 36

@chadgreen @chadgreen

SQL API – How: Insert

slide-37
SLIDE 37

@chadgreen @chadgreen

SQL API – How: Query

slide-38
SLIDE 38

@chadgreen @chadgreen

SQL API – Query

  • API (using Microsoft.Azure.Cosmos)
  • LINQ to SQL API
  • JavaScript
  • Stored Procedures
  • Triggers
  • User Defined Functions
  • Entity Framework
slide-39
SLIDE 39

@chadgreen @chadgreen

MongoDB

Document Database

slide-40
SLIDE 40

@chadgreen @chadgreen

API for MongoDB – What

  • Native MongoDB implementation
  • Allows existing client SDKs, drivers, and tools to interact transparently
  • Default is Mongo v3.2; v3.4 in preview
slide-41
SLIDE 41

@chadgreen @chadgreen

API for MongoDB – Why

Migrating data from a MongoDB database to Azure Cosmos DB’s fully managed service

slide-42
SLIDE 42

@chadgreen @chadgreen

API for MongoDB – How: Data Model

Filter: {"OwnerEmailAddress": "chadgreen@chadgreen.com"}

slide-43
SLIDE 43

@chadgreen @chadgreen

API for MongoDB – How: Insert

slide-44
SLIDE 44

@chadgreen @chadgreen

API for MongoDB – How: Insert

slide-45
SLIDE 45

@chadgreen @chadgreen

API for MongoDB – How: Query

slide-46
SLIDE 46

@chadgreen @chadgreen

Gremlin API

Graph Database

slide-47
SLIDE 47

@chadgreen @chadgreen

Gremlin API – What

  • Collection of vertices and edges
  • Represents entities as vertices and the ways in which those entities relate

to the world as relationships

  • Allows us to model all kinds of scenarios
slide-48
SLIDE 48

@chadgreen @chadgreen

Gremlin API – What

@ChadGreen @AzureCosmosDB @_LBosq

Follows Follows Follows Follows Follows

User User User

slide-49
SLIDE 49

@chadgreen @chadgreen

Gremlin API – Why

Building a graph database to model and traverse relationships among entities

slide-50
SLIDE 50

@chadgreen @chadgreen

Gremlin API – Why

  • Social Networks
  • Search
  • Recommendations
  • Communication networks
  • Identity and access management
  • Fraud detection

Represent data as it is found in nature

slide-51
SLIDE 51

@chadgreen @chadgreen

Gremlin API – How: Data Model

g.V().hasLabel (‘presentation’) .has(‘ownerEmailAddress’, ‘chadgreen@chadgreen.c

  • m’)
slide-52
SLIDE 52

@chadgreen @chadgreen

SQL API – How: Insert

slide-53
SLIDE 53

@chadgreen @chadgreen

SQL API – How: Query

"g.V() .hasLabel('tag’) .has('name’, 'Azure’) .in('taggedAs’) .hasLabel('presentation')"

slide-54
SLIDE 54

@chadgreen @chadgreen

Gremlin API – Query

  • API (using Gremlin.Net)
  • Community API (Gremlin.Net.CosmosDb)
  • JavaScript
  • Stored Procedures
  • Triggers
  • User Defined Functions
  • SQL API
slide-55
SLIDE 55

@chadgreen @chadgreen

Cassandra API

Wide Column Store

slide-56
SLIDE 56

@chadgreen @chadgreen

Cassandra API – What

  • Open-source, distributed, wide column store, NoSQL database
  • Designed to handle large amounts of data
  • Uses many commodity servers, providing high availability
  • Developed to power the Facebook inbox search feature
slide-57
SLIDE 57

@chadgreen @chadgreen

Casandra API – Why

Migrating data from Cassandra to Azure Cosmos DB

slide-58
SLIDE 58

@chadgreen @chadgreen

Cassandra API – How: Data Model

slide-59
SLIDE 59

@chadgreen @chadgreen

Cassandra API – How: Insert

slide-60
SLIDE 60

@chadgreen @chadgreen

Cassandra API – How: Insert

slide-61
SLIDE 61

@chadgreen @chadgreen

Cassandra API – How: Query

slide-62
SLIDE 62

@chadgreen @chadgreen

Cassandra API – Query

  • API (using CassandraCSharpDriver)
  • Cassandra Query Language (CQL)
  • Cassandra-based tools (like cqlsh)
slide-63
SLIDE 63

@chadgreen @chadgreen

Table API

Table Storage

slide-64
SLIDE 64

@chadgreen @chadgreen

Table API – What

  • Stores large amounts of structured data
  • Ideal for storing structured, non-relational data
slide-65
SLIDE 65

@chadgreen @chadgreen

Table API – Why

Migrating data from Azure Table storage to Cosmos DB

slide-66
SLIDE 66

@chadgreen @chadgreen

Table API – How: Data Model

slide-67
SLIDE 67

@chadgreen @chadgreen

Table API – How: Insert

slide-68
SLIDE 68

@chadgreen @chadgreen

Table API – How: Insert

slide-69
SLIDE 69

@chadgreen @chadgreen

Table API – How: Query

slide-70
SLIDE 70

@chadgreen @chadgreen

Call to Action

slide-71
SLIDE 71

@chadgreen @chadgreen

a z u r e . m i c r o s o f t . c o m / e n - u s / t r y / c o s m o s d b /

slide-72
SLIDE 72

@chadgreen @chadgreen

 c h a d g r e e n @ c h a d g r e e n . c o m  c h a d g r e e n . c o m  C h a d G r e e n  C h a d w i c k E G r e e n

Thank You