Elastic database patterns for SaaS applications in Azure Microsoft 2016 7/2/2018 9:57 AM BRK3064 Elastic database patterns for SaaS applications in Azure Torsten Grabs Principal Program Manager © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Agenda Overview of Azure SQL Database 7/2/2018 9:57 AM Agenda Overview of Azure SQL Database Canonical application architecture in Azure Azure SQL Database concepts Data Models for Elastic Database Apps Classification of database applications in Azure Data tier design patterns for multi-tenant and SaaS applications Design Patterns for Elastic Database Apps Manage database capacity at scale Query across many databases Orchestrating management tasks at scale Managing data distribution Transactions across databases Summary © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
01 | Azure SQL Database
Canonical Azure Application Model IoT Canonical Azure Application Model Application built on Microsoft Azure Network tier Azure Traffic Manager App tier Azure Web Jobs Azure Web Sites Azure Web Roles Data tier Azure SQL Database Azure DocumentDB Azure HDInsight Streaming Azure Storage Azure Search
Build 2015 7/2/2018 9:57 AM Azure SQL Database Fully managed SQL database service so you can focus on your business Built for SaaS and Enterprise applications Predictable performance & pricing 99.99% availability built-in Geo-replication and restore services for data protection Secure and compliant for your sensitive data Fully compatible with SQL Server 2014 databases © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Azure SQL Database Service Tiers Build 2015 7/2/2018 9:57 AM Azure SQL Database Service Tiers Basic Standard Premium Light transactional workloads Go-to option for most business applications High throughput and business-critical databases Intended Use 99.99% Availability • •• ••• Performance Fully compatible with SQL Server 2014 databases Programming Surface Isolated databases and elastic database pools Workload Elasticity © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Singleton vs Elastic Databases Singleton databases Fixed resource reservations Optimized for apps with predictable performance demands Seamless scale up and down through service tiers Elastic pool database Individual database resources fluctuate dynamically with capacity demands For workloads with unpredictable database resource consumption Pool resources shared among a group of databases Helps avoid overprovisioning databases to meet peak demand Elastic database pool can host hundreds of databases Resources and cost budget are per pool Cost are independent of database count in pool
Demo Creating an Azure SQL Database
02 | Data Models for Elastic Database Applications
Application Segments in SQL Database ISVs Going SaaS & Cloud-born SaaS Enterprise apps serving customers Enterprise apps serving employees Multi-tenant software application using thousands of databases to service their cloud hosted customers Applications designed for elasticity and scale with efficient and agile operational model Line of business applications empowering employees while remove CAPEX, reduce OPEX
SaaS provider customer (tenant) end-user Build 2015 7/2/2018 9:57 AM Data-intensive SaaS applications SaaS provider customer (tenant) end-user Scaling to unlimited customers Data isolation, privacy, protection Unpredictable usage across customers © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Multi-tenant Data Models Desirable application patterns with ideal tenant isolation properties and most cost-effective resource sharing Resource sharing Tenant Isolation Little resource sharing Lots of resource sharing Little isolation Lots of isolation Shared - Single All tenants in a single(large) database Database-per-tenant Every tenant gets its own DB Shared-Sharded Multiple tenants per DB, sharded across many DBs Increasing deployment & manageability cost Increasing cost for tenant isolation DevOps
Designed for SaaS: Azure SQL DB’s Elastic Capabilities Tenant Isolation Elastic database tools & capabilities Resource sharing Little resource sharing Lots of resource sharing Little isolation Lots of isolation Shared - Single All tenants in a single(large) database Database-per-tenant Every tenant gets its own DB Shared-Sharded Multiple tenants per DB, sharded across many DBs Increasing deployment & manageability cost Increasing cost for tenant isolation DevOps Database-per-tenant with Elastic Pools Tenant isolation combined with sharing resources in an elastic database pool
Demo WingTip Tickets SaaS Application
03 | Typical Design Patterns with Elastic Database SaaS Applications
Typical elastic database application architecture Scalable cloud service, load balanced in normal use Cloud Service Catalog database holds mapping to customer databases Catalog Customer Catalog Cust 1 Cust 2 Cust 3 Cust N Scale out data tier by adding additional customer databases Customer Databases
Pattern 1: Manage database capacity with many dbs Cloud Service Catalog Customer Catalog Cust 1 Cust 2 Cust 3 Cust 4 Cust 5 Cust 6 Cust 7 Cust 9 Cust 9 Cus Cus Cust N Cust 1 Cust 2 Cust 3 Cust 4 Cust 5 Cust 6 Cust 7 Cust 8 Customer Databases
Elastic Pools: Manage database resources Elastic databases, Elastic database pools Pooled resources leveraged by many databases Example: Standard elastic pool Standard elastic pool provides 200-1200* eDTUs for up to 400 databases Elastic Standard databases can burst up to 100 eDTUs (S3 level) Create/configure pool via portal, PowerShell, REST APIs Move databases in/out using portal, PowerShell, REST APIs, T-SQL Databases remain online throughout Monitoring and alerting is available on both pool and databases
Demo Elastic Database Pools
Pattern 2: Querying across many databases Cloud Service PowerBI Catalog Customer Catalog Elastic Query Cust 1 Cust 2 Cust 3 Cust N Customer Databases
Elastic Query: Querying across databases Connect to a single SQL DB database using familiar SQL DB connection strings Simple setup with T-SQL DDL Transparent querying of many databases from a single database Familiar programming experience with T-SQL, ADO. NET Linq, EF etc. Use familiar development and BI tools to query across many databases Designed for interactive querying
Demo Elastic Database Query
Pattern 3: Managing many databases Cloud Service Catalog Customer Catalog T-SQL Cust 1 Cust 2 Cust 3 Cust N Customer Databases
Elastic Jobs: Managing many databases Apply changes or administrative operations to many databases Use familiar T-SQL scripts to define jobs Built-in automatic retries in case of transient failures Tightly integrated with elastic pools in the new Azure Portal Powershell experience for more control Designed for batch processing
Demo Elastic Database Jobs
Pattern 4: Managing data distribution 1. End users connect to cloud service Cloud Service 2. Cloud service looks up customer in catalog 3. Cloud service routes directly to customer database Catalog Customer Catalog Cust 1 Cust 2 Cust 3 Cust N Customer Databases
Elastic Client Library: Manage data distribution Define and manage data distribution to databases Define the set of databases that is the data tier of your application Map customers (tenants) to databases Route database requests (data-dependent routing) Route incoming requests to the correct database Ensure correct routing if databases move Performance: Cache routing information
Demo Elastic Database Client Library
Pattern 5: Transactions across databases 1. End users connect to cloud service Cloud Service 2. Changes several databases as part of the request Catalog Customer Catalog Cust 1 Cust 2 Cust 3 Cust N Customer Databases
Elastic Transactions: Atomic changes across databases With Elastic transactions, you can run transactions that stretch across several databases in SQL DB Example use cases: Financial transactions across tenants in a SaaS application As part of order processing, updating the sales and inventory databases Familiar development experience with .NET Starting with .NET 4.6.1
Summary
Main take-aways Azure SQL Database SQL Server-based relational database in Azure with pay-as-you-go elasticity Data Models for Elastic Database Apps Different design patterns for data tiers from scale-up to scale-out Tenant isolation and density requirements define the options for multi-tenant and SaaS applications Design Patterns Manage database capacity at scale: Elastic Database Pools Query across many databases: Elastic Database Query Orchestrating management tasks at scale: Elastic Database Jobs Managing data distribution: Elastic Database Client Library Transactions across databases: Elastic Database Transactions
References Elastic Database overview: https://azure.microsoft.com/en-us/documentation/articles/sql- database-elastic-scale-introduction/ Elastic Pools: https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic-pool- guidance/ Elastic Query: https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic- query-overview/ Elastic Jobs: https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic-jobs- overview/ Elastic Tools: https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic- database-client-library/ Elastic Transactions: https://azure.microsoft.com/en-us/documentation/articles/sql-database- elastic-transactions-overview/
Free IT Pro resources To advance your career in cloud technology Microsoft Ignite 2016 7/2/2018 9:57 AM Free IT Pro resources To advance your career in cloud technology Plan your career path Microsoft IT Pro Career Center www.microsoft.com/itprocareercenter Cloud role mapping Expert advice on skills needed Self-paced curriculum by cloud role $300 Azure credits and extended trials Pluralsight 3 month subscription (10 courses) Phone support incident Weekly short videos and insights from Microsoft’s leaders and engineers Connect with community of peers and Microsoft experts Get started with Azure Microsoft IT Pro Cloud Essentials www.microsoft.com/itprocloudessentials Demos and how-to videos Microsoft Mechanics www.microsoft.com/mechanics Connect with peers and experts Microsoft Tech Community https://techcommunity.microsoft.com © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Please evaluate this session 7/2/2018 9:57 AM Please evaluate this session Your feedback is important to us! From your PC or Tablet visit MyIgnite at http://myignite.microsoft.com From your phone download and use the Ignite Mobile App by scanning the QR code above or visiting https://aka.ms/ignite.mobileapp © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
7/2/2018 9:57 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.