Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Database options
on Azure
Himanshu Desai
Principal Consultant, Technical Specialist (WCF)
1
Page
Agenda
› Understand Azure Database Offering
› Overview of Azure SQL Database
› Overview of Azure Table Storage
› Over...
Page / Copyright ©2015 by Readify Pty Ltd4
DB
SQL
DB
SQL
DB
SQL
App
SQL Azure
DB
Virtual Machine
SQL Server
Document DB
Pa...
Page
Who is responsible?
› Developers
› Testers
› Operations
/ Copyright ©2014 by Readify Pty Ltd5
SQL Azure
Page
Features
› Databaseasaservice
› ElasticScale withSharding*
› Predicatableperformance
› Availabilitybackedbyreplicaand...
Page
Sharding – Why?
› Thetotalamountofdataistoolargetofitwithintheconstraintsofasingledatabase
› Thetransactionthroughput...
Page
Horizontal Vs Vertical Scaling
/ Copyright ©2014 by Readify Pty Ltd9
Page
Single Vs Multi-Tenant
/ Copyright ©2014 by Readify Pty Ltd10
Page
Backup & Restore
› Pointintimerestore
› Geo-Restore
› StandardGeo-replication
› ActiveGeo-replication.
/ Copyright ©2...
Page
Management
› SQLManagementStudio
› RESTAPI’s
› PowershellScripts
› AzureManagementportal
/ Copyright ©2014 by Readify...
Page
What is not supported
› https://msdn.microsoft.com/en-us/library/azure/ee336281.aspx
/ Copyright ©2014 by Readify Pty...
Page
Demo
/ Copyright ©2014 by Readify Pty Ltd14
Page
Azure Table Storage
/ Copyright ©2014 by Readify Pty Ltd15
Page
What is Table Storage
› Auto-sharded, key value store
› Single table can contain upto 500TB at a cost of
7c/Gb/month
...
Page
Key Features
› Schema less with only 3 predefined fields
› Structured Storage
› Massively scalable tables
› Highly av...
Page
Required Entity Properties
› PartitionKey & RowKey
› Uniquely Identifies an entity
› Defines the sort order
› Use the...
Page
Table Storage Concepts
/ Copyright ©2014 by Readify Pty Ltd19
BooksOnline
Users
Books
Email
Name
Email
Name
Title
ISB...
Page
Table Data Model
› Table
› A Storage account can create many tables
› Table name is scoped by account
› Set of entiti...
PagePage / Copyright ©2014 by Readify Pty Ltd21
Partition Key
1
A
Row Key
Entity
Partition: ABC / Machine 1
1
2
A
Partitio...
Page
PartitionKey and Partitions
› PartitionKey
› Used to group entities in the table into parititions
› A table partition...
Page
Partitioning Tables- Why
› Scale
› Eachindividualpartitionsaredistributedacrossmultiplestoragenodes
› Systemmonitorst...
Page
Query Speed
› Fast
› Singleparitionkeyandrowkeywithequality
› Medium
› Singlepartionbutasmallrangeofrowkey
› Entirepa...
Page
Make Faster Queries
› LargeScans
› Splittherangeandparallelizequeries
› Createandmaintainownviewsthathelpqueries
› “O...
Page
Continuation token
› Maxof1krowsinaresponse
› Attheendofpartitionrangeboundary
› Maxof5secstoexecutethequery
› Expect...
Page
Pagination
› UseIQueryable<>.Take(N)tofetchthetopresults
› Usecontinuation
› http://<serviceUri>/Something?<originalQ...
Page
Retrieve latest value
› Have the row key as
› DateTime.MaxValue.Ticks-DateTime.UtcNow.Ticks
/ Copyright ©2014 by Read...
Page
Prefix based retrieval
› Use CompareTo and ‘>’ and ‘<‘ function effectively
› myTable.Partitionkey.CompareTo(“somekey...
Page
Demo
/ Copyright ©2014 by Readify Pty Ltd30
Page
DocumentDB
/ Copyright ©2014 by Readify Pty Ltd31
Page
What is DocumentDB?
› Document database that supports fully manage
storage of JSON documents in a highly performant
w...
Page
Key Features
› Schemaless,NoSQLdocumentdatabase
› Fullymanaged,withprovisionedcapacity
› AllowsforSQLlikequeriesonSem...
Page
Management
› Supportedinnewportal
› Managedatabaseaccount,collections,usersetc
› Viewconsumptionstatistics
› http://p...
Page
Overview of DocumentDB
/ Copyright ©2014 by Readify Pty Ltd35
Page
Database Accounts
/ Copyright ©2014 by Readify Pty Ltd36
Page
Resource Model
› DatabaseAccount
› Database
› Collection
› Document
› Attachment
› StoredProcedure
› Trigger
› User-d...
Page
Resource Addresssing
› Restful
› UniqueID
› APIUrl:
› https://{databaseaccount}.documents.azure.com
› DocumentPath
› ...
Page
Capacity Unit
› Databaseaccountscomeswithadministrative quotaof
› 100databases
› 500,000users
› 2,000,000permissions
...
Page
REST API
› Standard Operations
› Create,Delete,Put,Get,Post
› Permanent Uri on Create
› HMAC authentication using man...
Page
.NET Development
› You need following from the portal after provision a
database
› Endpoint Url
› Authorization key
›...
Page
Demo
/ Copyright ©2014 by Readify Pty Ltd42
PagePage / Copyright ©2014 by Readify Pty Ltd43
Table Storage SQL Azure DocumentDB
Semi-structured Fully Structured Semi-S...
Page
Thank you
Himanshu Desai
Himanshu.desai@readify.net
/ Copyright ©2014 by Readify Pty Ltd44
Upcoming SlideShare
Loading in …5
×

Storage Options on Windows Azure

649 views

Published on

Compare Storage options available on Windows azure. This presentation will compare SQL Azure, Table Storage and Document DB on azure.

Published in: Technology
  • Be the first to comment

Storage Options on Windows Azure

  1. 1. Database options on Azure Himanshu Desai Principal Consultant, Technical Specialist (WCF) 1
  2. 2. Page Agenda › Understand Azure Database Offering › Overview of Azure SQL Database › Overview of Azure Table Storage › Overview of DocumentDB › Suitability of Each options / Copyright ©2014 by Readify Pty Ltd2
  3. 3. Page / Copyright ©2015 by Readify Pty Ltd4 DB SQL DB SQL DB SQL App SQL Azure DB Virtual Machine SQL Server Document DB Partition Key Partition 1 2 A Table Storage 1 A Row Key Entity
  4. 4. Page Who is responsible? › Developers › Testers › Operations / Copyright ©2014 by Readify Pty Ltd5
  5. 5. SQL Azure
  6. 6. Page Features › Databaseasaservice › ElasticScale withSharding* › Predicatableperformance › AvailabilitybackedbyreplicaandSLA › Dataprotectionviaauditing,restoreandgeo-replication › Selfmanaged › Threereplicaarerunningatonetime(oneprimaryandtwoormoreseconday) › Availabilityin3Tiers:Basic(2GB),Standard(250GB)&Premium(500GB) / Copyright ©2014 by Readify Pty Ltd7
  7. 7. Page Sharding – Why? › Thetotalamountofdataistoolargetofitwithintheconstraintsofasingledatabase › Thetransactionthroughputoftheoverallworkloadexceedsthecapabilitiesofasingle database › Tenantsmayrequirephysicalisolationfromeachother,soseparatedatabasesareneeded foreachtenant › Differentsectionsofadatabasemayneedtoresideindifferentgeographiesfor compliance,performanceorgeopoliticalreasons. / Copyright ©2014 by Readify Pty Ltd8
  8. 8. Page Horizontal Vs Vertical Scaling / Copyright ©2014 by Readify Pty Ltd9
  9. 9. Page Single Vs Multi-Tenant / Copyright ©2014 by Readify Pty Ltd10
  10. 10. Page Backup & Restore › Pointintimerestore › Geo-Restore › StandardGeo-replication › ActiveGeo-replication. / Copyright ©2014 by Readify Pty Ltd11
  11. 11. Page Management › SQLManagementStudio › RESTAPI’s › PowershellScripts › AzureManagementportal / Copyright ©2014 by Readify Pty Ltd12
  12. 12. Page What is not supported › https://msdn.microsoft.com/en-us/library/azure/ee336281.aspx / Copyright ©2014 by Readify Pty Ltd13
  13. 13. Page Demo / Copyright ©2014 by Readify Pty Ltd14
  14. 14. Page Azure Table Storage / Copyright ©2014 by Readify Pty Ltd15
  15. 15. Page What is Table Storage › Auto-sharded, key value store › Single table can contain upto 500TB at a cost of 7c/Gb/month › Scalability Target of 20K ops/second / Copyright ©2014 by Readify Pty Ltd16
  16. 16. Page Key Features › Schema less with only 3 predefined fields › Structured Storage › Massively scalable tables › Highly available and durable › Data is replicated several times › Usage via REST API or Windows Azure Storage client libraries › Storing data for efficient retrieval and presistence/ Copyright ©2014 by Readify Pty Ltd17
  17. 17. Page Required Entity Properties › PartitionKey & RowKey › Uniquely Identifies an entity › Defines the sort order › Use them to scale your app › Timestamp › Readonly › Optimistic concurrency / Copyright ©2014 by Readify Pty Ltd18
  18. 18. Page Table Storage Concepts / Copyright ©2014 by Readify Pty Ltd19 BooksOnline Users Books Email Name Email Name Title ISBN Title ISBN Accounts Tables Entities
  19. 19. Page Table Data Model › Table › A Storage account can create many tables › Table name is scoped by account › Set of entities (i.e. rows) › Entity › Set of properties (columns) › Required properties › PartitionKey, RowKey & Timestamp / Copyright ©2014 by Readify Pty Ltd20
  20. 20. PagePage / Copyright ©2014 by Readify Pty Ltd21 Partition Key 1 A Row Key Entity Partition: ABC / Machine 1 1 2 A Partition: DEF / Machine 2 1 2 A Partition : HIJ / Machine 3 1 2 A PartitionId RowKey Name Address Timestamp ABC 1 … ABC 2 …. ABC 3 …. PartitionId RowKey Name Address Timestam p DEF 4 DEF 5 DEF 6 PartitionId RowKe y Name Address Timestam p HIJ 7 HIJ 8 HIJ 9
  21. 21. Page PartitionKey and Partitions › PartitionKey › Used to group entities in the table into parititions › A table partition › All entities with same partition key value › Unit of scale › Control entity locality › Row key provides uniqueness within a partition / Copyright ©2014 by Readify Pty Ltd22
  22. 22. Page Partitioning Tables- Why › Scale › Eachindividualpartitionsaredistributedacrossmultiplestoragenodes › Systemmonitorsthepartitionsusageandautomaticallybalances partitionsacrossmultiple storagenodes › Apartitionsi.e.allentitieswithsamepartitionkey,willbeservedbya singlenode › Entitygrouptransactions › AllowtheapplicationtoautoperformmultipleCreate/Update/Delete operationsacrossmultipleentitiesusingbatchrequest / Copyright ©2014 by Readify Pty Ltd23
  23. 23. Page Query Speed › Fast › Singleparitionkeyandrowkeywithequality › Medium › Singlepartionbutasmallrangeofrowkey › Entirepartitionortablethatissmall › Slow › Largesinglescan › Largetablescan › “OR”predicatesonkeys=>noqueryoptimisation =>resultsinscan › ExpectContinuationtokens / Copyright ©2014 by Readify Pty Ltd24
  24. 24. Page Make Faster Queries › LargeScans › Splittherangeandparallelizequeries › Createandmaintainownviewsthathelpqueries › “Or”Predicates › Executeindividualqueryinparallel › UserInteractive › Cachetheresulttoreducescanfrequency / Copyright ©2014 by Readify Pty Ltd25
  25. 25. Page Continuation token › Maxof1krowsinaresponse › Attheendofpartitionrangeboundary › Maxof5secstoexecutethequery › Expectcontinuationtokenalways › Ifthequerytimesout,Serverreturnscontinuationtokensothatclient canmakeanotherquery › Whenthescancrossesthepartitionboundaries,continuatin tokenis returned. / Copyright ©2014 by Readify Pty Ltd26
  26. 26. Page Pagination › UseIQueryable<>.Take(N)tofetchthetopresults › Usecontinuation › http://<serviceUri>/Something?<originalQuery>&NextPartitionKey=< someValue>&NextRowKey=<someOtherValue> / Copyright ©2014 by Readify Pty Ltd27
  27. 27. Page Retrieve latest value › Have the row key as › DateTime.MaxValue.Ticks-DateTime.UtcNow.Ticks / Copyright ©2014 by Readify Pty Ltd28
  28. 28. Page Prefix based retrieval › Use CompareTo and ‘>’ and ‘<‘ function effectively › myTable.Partitionkey.CompareTo(“somekey”)>=0 / Copyright ©2014 by Readify Pty Ltd29
  29. 29. Page Demo / Copyright ©2014 by Readify Pty Ltd30
  30. 30. Page DocumentDB / Copyright ©2014 by Readify Pty Ltd31
  31. 31. Page What is DocumentDB? › Document database that supports fully manage storage of JSON documents in a highly performant way. › Fully managed distributed database. › (Still in preview and available in West US,North & West Europe, cost around 73 cents a day which includes 50% discount.) / Copyright ©2014 by Readify Pty Ltd32
  32. 32. Page Key Features › Schemaless,NoSQLdocumentdatabase › Fullymanaged,withprovisionedcapacity › AllowsforSQLlikequeriesonSemistructureddata(i.e.JSONfiles) › Supportsstrongconsistencyfortransactionalapplications › Designedtoscaleintopetabytes › Includeslibraries forNode,.NET, REST,Javascript(Client&Server),Python › IncludesHekatontechnologies(InMemorySQL) / Copyright ©2014 by Readify Pty Ltd33
  33. 33. Page Management › Supportedinnewportal › Managedatabaseaccount,collections,usersetc › Viewconsumptionstatistics › http://portal.azure.com › Usetoolslike › Queryexplorer › Documentexplorer › DocumentDBstudio / Copyright ©2014 by Readify Pty Ltd34
  34. 34. Page Overview of DocumentDB / Copyright ©2014 by Readify Pty Ltd35
  35. 35. Page Database Accounts / Copyright ©2014 by Readify Pty Ltd36
  36. 36. Page Resource Model › DatabaseAccount › Database › Collection › Document › Attachment › StoredProcedure › Trigger › User-definedfunctions › User › Permission › Media / Copyright ©2014 by Readify Pty Ltd37
  37. 37. Page Resource Addresssing › Restful › UniqueID › APIUrl: › https://{databaseaccount}.documents.azure.com › DocumentPath › /dbs/{database id}/colls/{collectionid}/docs/{documentid} › Clientlibraries › .NET › Javascript › Python/ Copyright ©2014 by Readify Pty Ltd38
  38. 38. Page Capacity Unit › Databaseaccountscomeswithadministrative quotaof › 100databases › 500,000users › 2,000,000permissions Itincludesquotaforcollections* IfyourunoutofCU,addmore.TheyarestackablebackedbySSD. EachCUcomeswith3elasticcollections,2000RU&10GBofSSD backeddocumentstorage › Elasticbydefault.Documentportionedbycollectioncanhaveunlimited storage.Notscopedtomachine.Actsasatransactiondomain / Copyright ©2014 by Readify Pty Ltd39
  39. 39. Page REST API › Standard Operations › Create,Delete,Put,Get,Post › Permanent Uri on Create › HMAC authentication using management or resource key › DocumentDB request headers / Copyright ©2014 by Readify Pty Ltd40
  40. 40. Page .NET Development › You need following from the portal after provision a database › Endpoint Url › Authorization key › Nu-get package › Install-Package Microsoft.Azure.Documents.Client – Pre › Use them to create DocumentClient / Copyright ©2014 by Readify Pty Ltd41
  41. 41. Page Demo / Copyright ©2014 by Readify Pty Ltd42
  42. 42. PagePage / Copyright ©2014 by Readify Pty Ltd43 Table Storage SQL Azure DocumentDB Semi-structured Fully Structured Semi-Structured Loosely typed Strongly typed Document Based Access Non-Relational (Not RDMS) Relational (RDMS) Non-Relational Massively scalable Highly Scalable Massively Scalable REST API & Client SDK for querying Full SQL Support Good SQL Support for querying hierarchical data within a collection N/A Stored Procs, UDFs etc Stored Procs, UDFs etc Each CU comes with 3 collections. In Preview, collection can grow upto 10GB and 2K RU of throughput.
  43. 43. Page Thank you Himanshu Desai Himanshu.desai@readify.net / Copyright ©2014 by Readify Pty Ltd44

×