cosmos db service

23
Cosmos DB By Sakshi & Prashant

Upload: nexthoughts-technologies

Post on 21-Jan-2018

205 views

Category:

Technology


0 download

TRANSCRIPT

Cosmos DB

By Sakshi & Prashant

Agenda

What is CosmosDB ?

Advantages

Types

MySQL

MongoDB

What is CosmosDB ?

Azure Cosmos DB is Microsoft’s globally-distributed database service "for managing data at planet-scale" launched in May 2017. It builds upon and extends the earlier Azure DocumentDB, which was released in 2014. It is schema-less and generally classified as a NoSQL database

Advantages1. Global distribution We can distribute data to any number of Azure regions, with the click of a button. This enables us to put our data where our users are, ensuring the lowest possible latency to customers.Using Azure Cosmos DB's multi-homing APIs, the app always knows where the nearest region is and will send requests to the nearest data center.

2 Multiple data models and popular APIs for accessing and querying dataAPIs for the following data models are supported with SDKs available in multiple languages:

■ DocumentDB API■ MongoDB API■ Table API■ Graph (Gremlin) API■ Additional data models coming soon

3 Elastically scale throughput and storage on demand, worldwide○ Easily scale database throughput at a per second granularity, and change it

anytime you want.○ Scale storage size transparently and automatically to handle any size

requirements now and forever.

4 Build highly responsive and mission-critical applications○ Azure Cosmos DB guarantees end-to-end low latency at the 99th percentile to its

customers.○ For a typical 1 KB item, Cosmos DB guarantees end-to-end latency of reads under

10 ms and indexed writes under 15 ms at the 99th percentile, within the same Azure region. The median latencies are significantly lower (under 5 ms).

5 Ensure "always on" availability○ 99.99% availability within a single region.○ Deploy to any number of Azure regions for higher availability.○ Simulate a failure of one or more regions with zero-data loss guarantees.

7 No database schema/index management○ Stop worrying about keeping your database schema and indexes in-sync with your

application’s schema. We're schema-free.○ Azure Cosmos DB’s database engine is fully schema-agnostic – it automatically

indexes all the data it ingests without requiring any schema or indexes and serves blazing fast queries.

8 Low cost of ownership○ Five to ten times more cost effective than a non-managed solution.○ Three times cheaper than DynamoDB(No SQL)

Types

● MongoDB● DocumentDB● Table Key● Graph

MongoDB/DocumentDB

DocumentDb is extended from MongoDB

Store data in documents

DocumentDB developed by Microsoft

MongoDB developed by Mongo db Inc.

DocumentDB store data in JSON format while MongoDB store data in BSON

Table API in Azure Cosmo Db

A key-value store, or key-value database, is a data storage paradigm designed for storing, retrieving, and managing associative arrays, a data structure more commonly known today as a dictionary or hash. Dictionaries contain a collection of objects, or records, which in turn have many different fields within them, each containing data. These records are stored and retrieved using a key that uniquely identifies the record, and is used to quickly find the data within the database.

Gremlin API in Azure Cosmo Db

Model the real World

Relationship as First Class entity

Optimized for graph storage and traversal

Gremlin Standard

Comparision

Consistency Spectrum

MySQL

MySQL is the most popular Open Source Relational SQL Database Management System.

SLA’s

Relational +SQL Data model

Setup

1>PEM file

mysql -h mysql-prashant.mysql.database.azure.com -u mysql-prashant@mysql-prashant -p --ssl-ca=/home/sakshi/Desktop/BaltimoreCyberTrustRoot.crt.pem

2>Connection

url="jdbc:mysql://mysql-prashant.mysql.database.azure.com:3306/demo?verifyServerCertificate =true&useSSL=true&requireSSL=false"

dbCreate = "create"

logSql = false

username = "mysql-prashant@mysql-prashant"

password = "Fin@default1"

Demo

MongoDB

MongoDB is a cross-platform, document oriented database that provides, high performance and easy scalability. MongoDB works on concept of collection and document.

Setup

Plugin

compile "org.mongodb:mongo-java-driver:2.13.1"

Dependencies

compile "org.grails.plugins:mongodb:3.0.0"

Setup - connection with Azure MongoDB

url = "mongodb://cosmos-prashant-mongo:LOwFwijFWi3v3zC2iUP7oF51b0NSWBAMGodZrRXznwzX2O2kFd3ZOE3u7DGJedpHpG068JyGWMRFjBvVm8jnTg==@cosmos-prashant-mongo.documents.azure.com:10255/azure_session?ssl=true&replicaSet=globaldb"

Demo

Thank You