6/1/2018 10:10 AM BRK3120 Learning from MYOB: design patterns for SaaS applications on SQL Database Bill.Gibson@microsoft.com Principal Program Manager,

Slides:



Advertisements
Similar presentations
Migrate SQL Server Apps to SQL Azure Cloud DB
Advertisements

Use relational database as a service
Make your app a native part of Office with Add-ins
Virtual desktops in the cloud: Experiences from the field
Successfully migrate existing databases to Azure SQL Database
What’s new in Entity Framework Core 2.0
From IT Pros to IT Heroes - with Azure DevTest Labs
5/21/2018 9:40 PM BRK3021 Learn about modern infrastructure roles in RDS: Next generation Windows desktop & app virtualization Clark Nicholson - Principal.
5/22/2018 1:39 AM BRK2156 Power BI Report Server: Self-service BI and enterprise reporting on-premises Christopher Finlan Senior Program Manager © Microsoft.
Azure Machine Learning Deploying and Managing Models in production
Creating Enterprise Grade BI Models with Azure Analysis Services
Azure File Sync Setup, configuration and management
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.
Easily manage SQL everywhere from anywhere with SQL tools
Developing Hybrid Apps on Microsoft Azure Stack
6/17/ :27 AM BRK3341 Unlock extensibility by connecting your service to PowerApps and Microsoft Flow Theresa (Tessa) Palmer–Sr. Program Manager Sunay.
6/19/2018 2:57 AM THR3092 Monitor and investigate actions on your user and data with alerts, insights and reports Binyan Chen Program Manager II, Office.
Azure SDKs and Tools for You
7/2/2018 2:39 AM BRK2413 Customer lifecycle with LCS: Dynamics 365 for Finance and Operations, Enterprise edition Manali Dongre Senior Program Manager.
Elastic database patterns for SaaS applications in Azure
Understand Hybrid Identity with Azure and Azure Stack
Virtual Machine Diagnostics in Microsoft Azure
Understanding Multi-Geo Capabilities in Office 365
7/22/2018 9:21 PM BRK3270 Building a Better Data Solution: Microsoft SQL Server and Azure Data Services Joey D’Antoni Principal Consultant Denny Cherry.
Microsoft Ignite /31/ :08 AM
8/6/ :17 AM THR2214 Hybrid Cloud Activated A customer case study optimizing on-premises & Azure performance and cost Mor Cohen-Tal Senior Product.
Microsoft Planner: How to manage your team’s work in Office 365
Excel and Power BI Better Together Democratization of data
SQL Server for Java developers
Workflow Orchestration with Adobe I/O
Customize Office 365 Search and create result sources
How we got a traditional bank collaborating across boundaries
Find, try and get line-of-business apps on Microsoft AppSource
Developing an app for SharePoint autohosted in Azure
Automate all things! Microsoft Azure continuous deployment
Using AAD B2C for WordPress & Secure Deployment Scenario
Agile Planning with Visual Studio Team Services (VSTS)
9/22/2018 3:49 AM BRK2247 Learn from MVPs: Panel discussion on all things SharePoint and OneDrive © Microsoft Corporation. All rights reserved. MICROSOFT.
Plan your UC refresh correctly: Skype for Business Server 2019
Confidence at speed: Visual Studio 2017 and your CI pipeline
Azure PowerShell Aaron Roney Senior Program Manager Cormac McCarthy
Azure SQL Database: A Guided Tour
11/22/2018 1:43 PM THR3005 How to provide business insight from your data using Azure Analysis Services Peter Myers Bitwise Solutions © Microsoft Corporation.
Continuous Delivery with Visual Studio Team Services
Azure Advisor: Optimization in the best way
Mobile Center and VSTS:​ Better together for your Mobile DevOps
Microsoft products for non-profits
Power-up NoSQL with Azure Cosmos DB
Introduction to ASP.NET Core 1.0
Five cool things you can do with Windows PowerShell on Office 365
Securely pass passwords into your deployment
Overview: Dynamics 365 for Project Service Automation
Virtual Reality with Azure and Unity
Understand your Azure cloud assets dependencies with BMC Discovery
Surviving identity management in a hybrid world
TechEd /28/2019 7:27 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Breaking Down the Value of A Yammer Post: 20 Things to Do
Cool Microsoft Edge Tips and Tricks
Manage your App Service resources using Command line tools
“Hey Mom, I’ll Fix Your Computer”
4/21/2019 7:09 AM THR2098 Unlock New Opportunities with Nintex Hawkeye Process Intelligence and Workflow Analytics Sr. Product.
Business Continuity and the Microsoft Cloud
4/28/2019 3:30 AM THR1061 Learn how Dynamics 365, Office 365 and related applications work together to transform the workplace Donna Edwards Solution Architect.
Designing Bots that Fit Your Organization
Ask the Experts: Windows 10 deployment and servicing
Passwordless Service Accounts
Digital Transformation: Putting the Jigsaw Together
Diagnostics and troubleshooting in Azure App Service Support Center
Optimizing your content for search and discovery
Presentation transcript:

6/1/2018 10:10 AM BRK3120 Learning from MYOB: design patterns for SaaS applications on SQL Database Bill.Gibson@microsoft.com Principal Program Manager, Azure SQL Database © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Session objectives and takeaway 6/1/2018 10:10 AM Session objectives and takeaway Equip you… To select the best database model for your SaaS scenarios With patterns that can reduce development, management and resource costs, and time-to-market for SaaS apps With a sample application and scripts that embody these patterns Takeaway Rich management @ scale features, combined with best practices and patterns, make SQL Database scalable, flexible and cost-efficient data platform for multi-tenant SaaS applications © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda SaaS data management concerns Wingtip SaaS – sample SaaS app Microsoft Build 2017 6/1/2018 10:10 AM SaaS data management concerns Wingtip SaaS – sample SaaS app Data models for multi-tenant SaaS apps Design and management patterns, explored with the Wingtip SaaS app Agenda © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

SaaS data management concerns Build 2015 6/1/2018 10:10 AM SaaS data management concerns Per-tenant cost Tenant isolation Security, performance, lifetime management, etc. Scale Number of tenants, data volume, workload Business continuity, disaster recovery Tenant-level customization (sometimes) © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Wingtip SaaS app Web app for small venues that host events and want to sell tickets directly Multi-tenant app, backed by SQL Database Each venue gets a customized experience

Database models for multi-tenant SaaS apps Tenant Isolation Low High Single-tenant Every tenant gets its own DB #1 #2 #3 #4 #5 #1 #2 #3 #4 #5 #1 #2 #3 #4 #5 Sharded multi-tenant Multiple tenants per DB, sharded across many DBs 1-99 100-199 200-299 1-n Multi-tenant All tenants in a single (large) database 1-n 1-n

Hybrid model blends benefits of MT/ST Tenant Isolation Low High Single-tenant Every tenant gets its own DB #23 #39 #144 #211 #265 move/split Sharded multi-tenant Multiple tenants per DB, sharded across many DBs 1-99 100-199 200-299 Multi-tenant All tenants in a single (large) database

Single-tenant vs multi-tenant: pros and cons Strong tenant isolation (security, performance management, monitoring, index tuning, auditing, schema customization, lifetime management, etc.) Simpler schema/app design Provisioning standalone dbs for peaks is expensive Overkill for small data volumes Not practical at extreme scale (millions of tenants) #1 #2 #3 #4 #5 #1 #2 #3 #4 #5 #1 #2 #3 #4 #5 #23 #39 #144 #211 #265 1-99 100-199 200-299 Multi-Tenant Supports extreme scale with low per-tenant data volumes Lowest per-tenant cost Weak isolation (security, privacy, performance, etc.) More complex schema/app design Cumbersome lifetime management, etc.

Pools are cost-effective for unpredictable workloads 0:00 12:00 23:59 Mon Tue Wed Thu Fri Sat Sun 9:00 9:15 10:00 9:30 9:45 2015 2016 2017 Hourly share resources Daily Weekly Yearly Elastic Pool Individually unpredictable Collectively stable and predictable Expensive, must provision each db for peaks Cost effective, scale pool up/down based on trends

Demo Wingtip SaaS app -> Database-per-tenant version Microsoft Build 2017 6/1/2018 10:10 AM Wingtip SaaS app -> Database-per-tenant version -> Hybrid multi-tenant version Demo © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MYOB ….and not a DBA in sight ! 6/1/2018 10:10 AM MYOB Australian accounting ISV, targeting SMBs Migrated an established desktop app to a hybrid rich-client/cloud app Single-database desktop app migrated easily to a single-tenant model Initially used standalone databases Considered using a multi-tenant database solution (did a POC) Elastic pool-based solution had lower TCO, let them focus on their business 150,000 tenant databases, growing at 3-5K/month 300+ eDTU elastic pools, with 485 databases per pool ….and not a DBA in sight ! © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MYOB elastic pool usage example 385 dbs in 200 DTU pool, per-database max at 100 DTUs

Learning from MYOB and other ISVs Microsoft Build 2017 6/1/2018 10:10 AM Learning from MYOB and other ISVs Developed SaaS patterns that address key design and management scenarios that are important at scale © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Patterns compose into E2E SaaS scenario 6/1/2018 10:10 AM Patterns compose into E2E SaaS scenario Geo-replication, failover groups Tenant self service Geo-replicate dbs for fastest recovery Geo-restore, aliases Reactive Restore from geo-redundant backup Tenant self service Azure Automation Pro-active Authentication, access control Azure Active Directory Scheduled Active/active cross-replication PITR Managed recovery of tenants at scale Recover tenant data after tenant error Reactive Handle intense isolated tenant workload SQL DW SQL DB + ColumnStore Pro-active Elastic Jobs Geo-distributed tenant dbs Handle fluctuating aggregate workload BCDR Azure Search Extract and analyze tenant data Search Scheduled Database per Tenant PowerBI Cross-tenant Analytics Azure Automation + ARM templates Query across tenant databases Manage performance Provision database and schema Elastic Query Monitoring and alerting ARM template, bacpac, db-copy Elastic Pools Scale databases Manage schema change Elastic Jobs Portal + OMS Catalog tenants and databases Monitor app and data layer Manage schema versioning via catalog Auto-provision databases Elastic Database Client Library, Shard Management schema Load-balance Browse tenants Pre-provision databases to reduce tenant onboarding latency Manage extended tenant meta data Connect app to tenant database Elastic Pools © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Patterns compose into E2E SaaS scenario 6/1/2018 10:10 AM Patterns compose into E2E SaaS scenario Geo-replication, failover groups Tenant self service Geo-replicate dbs for fastest recovery Geo-restore, aliases Reactive Restore from geo-redundant backup Tenant self service Azure Automation Pro-active Row-level security Azure Active Directory Scheduled Active/active cross-replication PITR Managed recovery of tenants at scale Authentication, access control Recover tenant data after tenant error Reactive Handle intense isolated tenant workload SQL DW SQL DB + ColumnStore Pro-active Elastic Jobs Geo-distributed tenant dbs Handle fluctuating aggregate workload BCDR Azure Search Extract and analyze tenant data Search Scheduled Multi-tenant Database PowerBI Cross-tenant Analytics Azure Automation + ARM templates Query across tenant databases Manage performance Provision database and schema Elastic Query Monitoring and alerting ARM template, bacpac, db-copy Elastic Pools Scale databases Manage schema change Elastic Jobs Portal + OMS Catalog tenants and databases Monitor app and data layer Manage schema versioning via catalog Auto-provision databases Elastic Database Client Library, Shard Management schema Load-balance Browse tenants Pre-provision databases to reduce tenant onboarding latency Manage extended tenant meta data Connect app to tenant database Elastic Pools Split-Merge service © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Canonical database-per-tenant SaaS app 6/1/2018 10:10 AM Canonical database-per-tenant SaaS app Scalable, load balanced Apps Catalog Tenant Catalog Holds mapping of tenants to databases plus tenant meta data Tenant databases in elastic pools for cost effective resource sharing, or stand-alone, depending on workloads Tenant A Tenant B Tenant C Tenant D Tenant N Tenant Databases All databases have same schema, no sharding key required in tables © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Canonical hybrid multi-tenant SaaS app 6/1/2018 10:10 AM Canonical hybrid multi-tenant SaaS app Scalable, load balanced Apps Catalog Tenant Catalog Holds mapping of tenants to databases plus tenant meta data Tenants1 Tenants2 TenantsN Tenant databases host single or multiple tenants depending on isolation/cost objectives. Databases in pools or stand-alone, scaled to aggregate load. Tenant A Tenant B Tenant C Tenant D … Tenant Databases All databases have same schema, sharded tables include tenant id as sharding key in PK © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Wingtip SaaS sample app Azure Web app (ASP.NET Core + EF Core) Deploys to Azure in under 5 mins Uses database-per-tenant with elastic pools Hybrid multi-tenant version in development Management scenarios implemented in PowerShell All code on GitHub https://github.com/Microsoft/WingtipSaaS Tutorials online https://aka.ms/sqldbsaastutorial Wingtip SaaS sample app © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

supported scenarios and patterns 6/1/2018 10:10 AM Tenant provisioning and cataloging using Elastic Datable Client Library Tenant database connection via catalog Performance monitoring, alerting using Portal and OMS Performance management using a load generator (incl. scale/load balance pool, isolate heavily loaded database) Schema management using Elastic Jobs Distributed cross-tenant query using Elastic Query Tenant data extract and analysis (using SQL DB or SQL DW + PowerBI for data visualization) Restore tenant data after tenant error DR using geo-restore and tenant aliases (in work) DR using geo-replication and failover groups (in work) Wingtip SaaS sample app supported scenarios and patterns © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Exploring the patterns 6/1/2018 10:10 AM Exploring the patterns A look at some of the design and management patterns explored in the Wingtip SaaS tutorials © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Provisioning tenants Apps Tenant Catalog Tenant Databases Catalog 6/1/2018 10:10 AM Provisioning tenants Apps Catalog Tenant Catalog Cust 1 Cust 2 Cust 3 Cust N Tenant Databases © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Provisioning tenants Apps Tenant Catalog Elastic Data Client Library Tenant Onboarding Application flow A. Venue signs up as new tenant 1. User connects to the app 2. App gets/computes key, looks up tenant in catalog B. App provisions new tenant db Apps 3. …then connects to correct tenant database C. …registers tenant key, db location in catalog EDCL 4. On subsequent requests, uses database location cached in EDCL Tenant bacpac Base TenantDB Catalog ARM / SQL Database Tenant Catalog Cust 1 Cust 2 Cust 3 Cust 4 Cust N EDCL Elastic Data Client Library .NET/Java (preview) Tenant Databases

Managing unpredictable tenant workloads 1. Provisioning service creates pool 2. …pre-provisions databases 3. As tenants register they are assigned databases Apps 4. Service pre-provisions next pool and databases 5. Pool is scaled to handle more load/databases Catalog ARM / SQL Database 6. Databases are moved to load-balance pools 7. Databases can be moved out if they become very active pool1 pool2 pool3 Cust 10 Cust 11 Cust 4 Cust 17 Cust 1 Cust 2 Cust 3 Cust 12 Cust 13

Monitor Elastic Pool and Database usage using portal or OMS Microsoft Build 2017 6/1/2018 10:10 AM Monitor Elastic Pool and Database usage using portal or OMS Load generator allows several scenarios to be explored © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Schema management at scale Manage 1000s of databases as one Azure Portal Apps Job Account T-SQL CREATE TABLE… CREATE INDEX… INSERT INTO… SELECT * FROM… T-SQL Job Catalog Tenant Catalog Elastic Jobs Cust 1 Cust 2 Cust 3 Cust 4 Cust N T-SQL T-SQL T-SQL T-SQL T-SQL Tenant Databases

Distributed query across tenant databases Query all tenants as if they are in a single database PowerBI Query from any client Apps Elastic Query Database locations are retrieved from catalog Adhoc Analytics External tables project data from tenant dbs Catalog Tenant Catalog Cust 1 Cust 2 Cust 3 Cust 4 Cust N Distributed query plan Tenant Databases

Extract tenant data into an analytics DB or DW Unlock operational and application insights PowerBI Query from any client Azure Portal Apps Job Account T-SQL CREATE TABLE… CREATE INDEX… INSERT INTO… SELECT * FROM… T-SQL Job Catalog Adhoc Analytics Tenant Analytics Tenant Catalog Elastic Jobs SQL DB with ColumnStore or SQL DW Cust 1 Cust 2 Cust 3 Cust 4 Cust N T-SQL T-SQL T-SQL T-SQL T-SQL Tenant Databases

Wrap up and call to action 6/1/2018 10:10 AM Wrap up and call to action You should now be equipped… To match your scenarios to common SaaS data models To explore SaaS-specific patterns that can reduce development, management and resource costs, and time-to-market Takeaway Rich management @ scale features, combined with best practices and patterns, make SQL Database scalable, flexible and cost-efficient data platform for multi-tenant SaaS applications Install the sample, try the tutorials, send us feedback saasfeedback@microsoft.com © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Microsoft Build 2017 6/1/2018 10:10 AM Resources Blog post https://azure.microsoft.com/en-us/blog/saas-patterns-accelerate-saas-application-development-on-sql-database/ GitHub repo https://github.com/microsoft/wingtipsaas Tutorials https://aka.ms/sqldbsaastutorial Getting started guide - installing and exploring the app https://docs.microsoft.com/en-us/azure/sql-database/sql-database-saas-tutorial © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Please evaluate this session Tech Ready 15 6/1/2018 Please evaluate this session From your Please expand notes window at bottom of slide and read. Then Delete this text box. PC or tablet: visit MyIgnite https://myignite.microsoft.com/evaluations Phone: download and use the Microsoft Ignite mobile app https://aka.ms/ignite.mobileapp Your input is important! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6/1/2018 10:10 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.