SlideShare a Scribd company logo
1 of 39
Henry Been
How to build a multi-tenant SaaS application using 60.000
databases
Server 1 Server 2 Server 3 Server 4 Server n
Database
loadbalancing
WHY?
•Single point of failure
•More expensive
•Cannot grow in small steps
•Scaling up is failing up [1]
[1] Scalability rules: 50 principles for Scaling Web Sites
WHY?
MANY, MANY
SMALLER
DATABASES
to the resue!
Server 1 Server 2 Server 3 Server 4 Server n
DB
loadbalancing
DB DB DB DB DB
•Unlimited scaleability
•Isolation of failure
•Roughly 2,5 times cheaper
Database per tenant provides…
100% tenant isolation
•Snapshot backup/restore
•Recover to point in time
•Compliance
•Limited authorization risks
100% tenant isoluation
•Designed for single tenant, single db
•Move to the cloud, one by one
•Use case I will present
Cloud strategy for legacy applications
WONDERING WHO
IS THAT GUY?
HENRY BEEN
Independent Devops & Azure Architect
E: consultancy@henrybeen.nl
T: @henry_been
L: linkedin.com/in/henrybeen
W: henrybeen.nl
A (very) short history of multi-tenancy
Tenant C
Standalone App
Tenant B
Tenant
DB
App
Tenant A
A (very) short history of multi-tenancy
App
Sharded Multi-tenant Database
Catalog
Tenant
C
Tenant
B
App
Tenant
M
Catalog
Tenants
A,B,C,D
Tenant
A
Tenants
E,F,J,K
Share everything Database per Tenant
Tenant
DB
App
Tenant
L
"Incidental Expenses" (CC BY-NC 2.0) by tim ellis
"O’ the Mysteries of Colorado" (CC BY-NC 2.0) by WarzauWynn
SnelStart
A
SnelStart
AA
SnelStart
SnelStart
A
Web-
application A
SnelStart
SnelStart
Web-
application A
User
Directory
Catalog
Cust 1 Cust 2 Cust 3 Cust N
2. App uses key to get
connection from catalog
Tenant Databases
4. On subsequent requests, use a
cache!
Tenant Catalog
1. User connects to the app
Selfservice tenant creation and destruction
A. User signs up for a new
tenant
Cust 4
B. App provisions new
tenant db
C. …registers tenant key,
db location in catalog
3. …then connects to correct
tenant database
ARM / SQL Database
Tenant Onboarding Application Connection
Base
TenantDB
Tenant
bacpac
Apps
Catalog
Cust 1 Cust 2 Cust 3 Cust N
Tenant Databases
Tenant Catalog
More simple approach: no selfservice
Apps
Management scripts
AAD
So…. what do I need?
"tools" (CC BY-NC-ND 2.0) by ᴾᴴᴵᴸ
Individually unpredictable
share
resources
Collectively stable and predictable
Cost effective,
scale pool up/down based on trends
Expensive,
must provision each db for peaks
Pools are cost-effective for unpredictable workloads
Elastic pool usage example
385 dbs in 200 DTU pool, per-database max at 100 DTUs
Elastic
Database
Client Library
Elastic
Database
Jobs
Elastic
Transactions
Elastic
Query
More elastic capabilities for Azure SQL DB
Elastic Database Client Library
using (SqlConnection conn = customerShardMap.OpenConnectionForKey(
customerId,
Configuration.GetCredentialsConnectionString(),
ConnectionOptions.Validate))
{
// Execute a simple command.
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = @"UPDATE Sales.Customer ….";
// … and more boring stuff ..
}
Elastic Transactions
using (var scope = new TransactionScope())
{
using (var conn1 = new SqlConnection(connStrDb1))
{ // … boring stuff … }
using (var conn2 = new SqlConnection(connStrDb2))
{ // … boring stuff }
scope.Complete();
}
Cust 1 Cust 2 Cust 3 Cust N
Schema management at scale
Cust 4
Catalog
Manage 1000s of databases as one
Apps
T-SQLT-SQLT-SQL T-SQLT-SQL
Azure Portal
Job
Account
T-SQL
CREATE TABLE…
CREATE INDEX…
INSERT INTO…
SELECT * FROM…
T-SQL Job
SELECT * FROM…
Elastic Jobs
Tenant Databases
Tenant Catalog
Jobs, target groups,
schedules, credentials
Cust 1 Cust 2
Tenant Databases
Cust 3 Cust N
Distributed query across tenant databases
Tenant Catalog
Adhoc
Analytics
Cust 4
Catalog
Database locations are
retrieved from catalog
Distributed query plan
External tables
project data from
tenant dbs
PowerBI
Query from any client
Query all tenants as if they are in a single database
Apps
Elastic Query
demo
Wingtip Tickets SaaS app
Standalone App Database per tenant Sharded Multi-tenant
Scale High
1-1000s
Very high
1-100,000s
Unlimited
1-1,000,000s
Database cost–per tenant High (sized for peaks) Low (using pools) Lowest (small tenants)
Tenant isolation Very High High Low (high for singletons)
Performance monitoring/mgt. Per-tenant Aggregate + per-tenant Aggregate, per-tenant for
singletons only
Restore single tenant Easy Easy Hard (easy for singletons)
Disaster recovery (all tenants) Moderate
Many components to
recover
Moderate
Patterns address complexity at
scale
Easy (for multi-tenant dbs)
Patterns address singleton
complexity at scale
Development complexity Low Low Medium (sharding)
Operational complexity Medium-High
Individually simple, complex
at scale
Low-Medium
Patterns address complexity at
scale
Low-High
Individual tenant management
is complex
Per-tenant customization Easy Easy Complex
Comparing the models, what we see…
DO TRY THIS AT HOME!
HENRY BEEN
Independent Devops & Azure Architect
E: consultancy@henrybeen.nl
T: @henry_been
L: linkedin.com/in/henrybeen
W: henrybeen.nl

More Related Content

What's hot

From AWS to GCP, TABLEAPP Architecture Story
From AWS to GCP, TABLEAPP Architecture StoryFrom AWS to GCP, TABLEAPP Architecture Story
From AWS to GCP, TABLEAPP Architecture StoryYen-Wen Chen
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Philipp Garbe
 
[GS네오텍] Google Kubernetes Engine
[GS네오텍]  Google Kubernetes Engine [GS네오텍]  Google Kubernetes Engine
[GS네오텍] Google Kubernetes Engine GS Neotek
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetescraigbox
 
Amazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep DiveAmazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep DiveAmazon Web Services
 
Tableapp architecture migration story for GCPUG.TW
Tableapp architecture migration story for GCPUG.TWTableapp architecture migration story for GCPUG.TW
Tableapp architecture migration story for GCPUG.TWYen-Wen Chen
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPWalter Liu
 
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...Amazon Web Services
 
Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016Philipp Garbe
 
Long running aws lambda - Joel Schuweiler, Minneapolis
Long running aws lambda -  Joel Schuweiler, MinneapolisLong running aws lambda -  Joel Schuweiler, Minneapolis
Long running aws lambda - Joel Schuweiler, MinneapolisAWS Chicago
 
Node.js on Windows Azure
Node.js on Windows AzureNode.js on Windows Azure
Node.js on Windows AzureNeil Mackenzie
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud PlatformOpsta
 
Lab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with RelationalLab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with RelationalAmazon Web Services
 
Google Compute Engine
Google Compute EngineGoogle Compute Engine
Google Compute EngineCsaba Toth
 
Windows Azure HDInsight Service
Windows Azure HDInsight ServiceWindows Azure HDInsight Service
Windows Azure HDInsight ServiceNeil Mackenzie
 
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETESZalando adtech lab
 
Leveraging Amzon EC2 Container Services for Container Orchestration
Leveraging Amzon EC2 Container Services for Container OrchestrationLeveraging Amzon EC2 Container Services for Container Orchestration
Leveraging Amzon EC2 Container Services for Container OrchestrationNeeraj Shah
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformMinku Lee
 

What's hot (20)

From AWS to GCP, TABLEAPP Architecture Story
From AWS to GCP, TABLEAPP Architecture StoryFrom AWS to GCP, TABLEAPP Architecture Story
From AWS to GCP, TABLEAPP Architecture Story
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
 
[GS네오텍] Google Kubernetes Engine
[GS네오텍]  Google Kubernetes Engine [GS네오텍]  Google Kubernetes Engine
[GS네오텍] Google Kubernetes Engine
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetes
 
JOSA TechTalks - Downgrade your Costs
JOSA TechTalks - Downgrade your CostsJOSA TechTalks - Downgrade your Costs
JOSA TechTalks - Downgrade your Costs
 
Amazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep DiveAmazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep Dive
 
Tableapp architecture migration story for GCPUG.TW
Tableapp architecture migration story for GCPUG.TWTableapp architecture migration story for GCPUG.TW
Tableapp architecture migration story for GCPUG.TW
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
 
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
AWS September Webinar Series - Visual Effects Rendering in the AWS Cloud with...
 
Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016
 
Getting Started with Amazon ECS
Getting Started with Amazon ECSGetting Started with Amazon ECS
Getting Started with Amazon ECS
 
Long running aws lambda - Joel Schuweiler, Minneapolis
Long running aws lambda -  Joel Schuweiler, MinneapolisLong running aws lambda -  Joel Schuweiler, Minneapolis
Long running aws lambda - Joel Schuweiler, Minneapolis
 
Node.js on Windows Azure
Node.js on Windows AzureNode.js on Windows Azure
Node.js on Windows Azure
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud Platform
 
Lab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with RelationalLab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with Relational
 
Google Compute Engine
Google Compute EngineGoogle Compute Engine
Google Compute Engine
 
Windows Azure HDInsight Service
Windows Azure HDInsight ServiceWindows Azure HDInsight Service
Windows Azure HDInsight Service
 
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES
12.07.2017 Docker Meetup - POSTGRE SQL ON KUBERNETES
 
Leveraging Amzon EC2 Container Services for Container Orchestration
Leveraging Amzon EC2 Container Services for Container OrchestrationLeveraging Amzon EC2 Container Services for Container Orchestration
Leveraging Amzon EC2 Container Services for Container Orchestration
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud Platform
 

Similar to Cloud brew cloudcamp

AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...
AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...
AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...Amazon Web Services
 
T1 – Architecting highly available applications on aws
T1 – Architecting highly available applications on awsT1 – Architecting highly available applications on aws
T1 – Architecting highly available applications on awsAmazon Web Services
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesNathan Burrell
 
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법Amazon Web Services Korea
 
AWS Cloud Kata | Taipei - Getting to Scale
AWS Cloud Kata | Taipei - Getting to ScaleAWS Cloud Kata | Taipei - Getting to Scale
AWS Cloud Kata | Taipei - Getting to ScaleAmazon Web Services
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinAmazon Web Services
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinIan Massingham
 
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)Amazon Web Services Korea
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAmazon Web Services
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupAmazon Web Services
 
Monitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSMonitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSAmazon Web Services
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayAmazon Web Services Korea
 
Satrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSSatrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSIdan Tohami
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesDataWorks Summit
 
Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud Datavail
 
Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsAvere Systems
 
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Amazon Web Services
 

Similar to Cloud brew cloudcamp (20)

AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...
AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...
AWS Summit 2013 | India - Scaling Seamlessly and Going Global with the Cloud,...
 
T1 – Architecting highly available applications on aws
T1 – Architecting highly available applications on awsT1 – Architecting highly available applications on aws
T1 – Architecting highly available applications on aws
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by Kubernetes
 
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법
갑작스러운 유저의 수요 증가에 현명하게 대처하는 방법
 
AWS Cloud Kata | Taipei - Getting to Scale
AWS Cloud Kata | Taipei - Getting to ScaleAWS Cloud Kata | Taipei - Getting to Scale
AWS Cloud Kata | Taipei - Getting to Scale
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit Dublin
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit Dublin
 
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWS
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a Startup
 
Create cloud service on AWS
Create cloud service on AWSCreate cloud service on AWS
Create cloud service on AWS
 
Monitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSMonitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECS
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 
Satrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSSatrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWS
 
AWS Black Belt Tips
AWS Black Belt TipsAWS Black Belt Tips
AWS Black Belt Tips
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
 
Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud
 
Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for Analysts
 
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
 

More from Henry Been

Henry been azure resource manager - inside out
Henry been   azure resource manager - inside outHenry been   azure resource manager - inside out
Henry been azure resource manager - inside outHenry Been
 
Dot netsaterday henry been - logging instrumentation dashboards alerts
Dot netsaterday   henry been - logging instrumentation dashboards alertsDot netsaterday   henry been - logging instrumentation dashboards alerts
Dot netsaterday henry been - logging instrumentation dashboards alertsHenry Been
 
Cloud brew henry been - logging instrumentation dashboards alerts
Cloud brew   henry been - logging instrumentation dashboards alertsCloud brew   henry been - logging instrumentation dashboards alerts
Cloud brew henry been - logging instrumentation dashboards alertsHenry Been
 
Henry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been
 
Serverless computing henry been - logging instrumentation dashboards alerts
Serverless computing   henry been - logging instrumentation dashboards alertsServerless computing   henry been - logging instrumentation dashboards alerts
Serverless computing henry been - logging instrumentation dashboards alertsHenry Been
 
Serverless computing henry been - continuous deployment of azure functions
Serverless computing   henry been - continuous deployment of azure functionsServerless computing   henry been - continuous deployment of azure functions
Serverless computing henry been - continuous deployment of azure functionsHenry Been
 
Logging, Instrumentation, Dashboards and Alerts - for developers
Logging, Instrumentation, Dashboards and Alerts - for developersLogging, Instrumentation, Dashboards and Alerts - for developers
Logging, Instrumentation, Dashboards and Alerts - for developersHenry Been
 
Secure deployments keeping your application secrets private -duug fest
Secure deployments   keeping your application secrets private -duug festSecure deployments   keeping your application secrets private -duug fest
Secure deployments keeping your application secrets private -duug festHenry Been
 
Secure deployments keeping your application secrets private - condensed
Secure deployments   keeping your application secrets private - condensedSecure deployments   keeping your application secrets private - condensed
Secure deployments keeping your application secrets private - condensedHenry Been
 
Writing, build and releasing your own vsts extension
Writing, build and releasing your own vsts extensionWriting, build and releasing your own vsts extension
Writing, build and releasing your own vsts extensionHenry Been
 
Continuous delivery for the it pro
Continuous delivery for the it proContinuous delivery for the it pro
Continuous delivery for the it proHenry Been
 
Focus on business value by going Serverless
Focus on business value by going ServerlessFocus on business value by going Serverless
Focus on business value by going ServerlessHenry Been
 
Henry been database-per-tenant with 50k databases
Henry been   database-per-tenant with 50k databasesHenry been   database-per-tenant with 50k databases
Henry been database-per-tenant with 50k databasesHenry Been
 
Henry been - Multi-tenant applications using 30k databases
Henry been - Multi-tenant applications using 30k databasesHenry been - Multi-tenant applications using 30k databases
Henry been - Multi-tenant applications using 30k databasesHenry Been
 

More from Henry Been (14)

Henry been azure resource manager - inside out
Henry been   azure resource manager - inside outHenry been   azure resource manager - inside out
Henry been azure resource manager - inside out
 
Dot netsaterday henry been - logging instrumentation dashboards alerts
Dot netsaterday   henry been - logging instrumentation dashboards alertsDot netsaterday   henry been - logging instrumentation dashboards alerts
Dot netsaterday henry been - logging instrumentation dashboards alerts
 
Cloud brew henry been - logging instrumentation dashboards alerts
Cloud brew   henry been - logging instrumentation dashboards alertsCloud brew   henry been - logging instrumentation dashboards alerts
Cloud brew henry been - logging instrumentation dashboards alerts
 
Henry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets private
 
Serverless computing henry been - logging instrumentation dashboards alerts
Serverless computing   henry been - logging instrumentation dashboards alertsServerless computing   henry been - logging instrumentation dashboards alerts
Serverless computing henry been - logging instrumentation dashboards alerts
 
Serverless computing henry been - continuous deployment of azure functions
Serverless computing   henry been - continuous deployment of azure functionsServerless computing   henry been - continuous deployment of azure functions
Serverless computing henry been - continuous deployment of azure functions
 
Logging, Instrumentation, Dashboards and Alerts - for developers
Logging, Instrumentation, Dashboards and Alerts - for developersLogging, Instrumentation, Dashboards and Alerts - for developers
Logging, Instrumentation, Dashboards and Alerts - for developers
 
Secure deployments keeping your application secrets private -duug fest
Secure deployments   keeping your application secrets private -duug festSecure deployments   keeping your application secrets private -duug fest
Secure deployments keeping your application secrets private -duug fest
 
Secure deployments keeping your application secrets private - condensed
Secure deployments   keeping your application secrets private - condensedSecure deployments   keeping your application secrets private - condensed
Secure deployments keeping your application secrets private - condensed
 
Writing, build and releasing your own vsts extension
Writing, build and releasing your own vsts extensionWriting, build and releasing your own vsts extension
Writing, build and releasing your own vsts extension
 
Continuous delivery for the it pro
Continuous delivery for the it proContinuous delivery for the it pro
Continuous delivery for the it pro
 
Focus on business value by going Serverless
Focus on business value by going ServerlessFocus on business value by going Serverless
Focus on business value by going Serverless
 
Henry been database-per-tenant with 50k databases
Henry been   database-per-tenant with 50k databasesHenry been   database-per-tenant with 50k databases
Henry been database-per-tenant with 50k databases
 
Henry been - Multi-tenant applications using 30k databases
Henry been - Multi-tenant applications using 30k databasesHenry been - Multi-tenant applications using 30k databases
Henry been - Multi-tenant applications using 30k databases
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Cloud brew cloudcamp

  • 1. Henry Been How to build a multi-tenant SaaS application using 60.000 databases
  • 2.
  • 3. Server 1 Server 2 Server 3 Server 4 Server n Database loadbalancing
  • 5. •Single point of failure •More expensive •Cannot grow in small steps •Scaling up is failing up [1] [1] Scalability rules: 50 principles for Scaling Web Sites WHY?
  • 7. Server 1 Server 2 Server 3 Server 4 Server n DB loadbalancing DB DB DB DB DB
  • 8. •Unlimited scaleability •Isolation of failure •Roughly 2,5 times cheaper Database per tenant provides…
  • 9. 100% tenant isolation •Snapshot backup/restore •Recover to point in time •Compliance •Limited authorization risks 100% tenant isoluation
  • 10.
  • 11. •Designed for single tenant, single db •Move to the cloud, one by one •Use case I will present Cloud strategy for legacy applications
  • 12. WONDERING WHO IS THAT GUY? HENRY BEEN Independent Devops & Azure Architect E: consultancy@henrybeen.nl T: @henry_been L: linkedin.com/in/henrybeen W: henrybeen.nl
  • 13. A (very) short history of multi-tenancy Tenant C Standalone App Tenant B Tenant DB App Tenant A
  • 14. A (very) short history of multi-tenancy App Sharded Multi-tenant Database Catalog Tenant C Tenant B App Tenant M Catalog Tenants A,B,C,D Tenant A Tenants E,F,J,K Share everything Database per Tenant Tenant DB App Tenant L
  • 15. "Incidental Expenses" (CC BY-NC 2.0) by tim ellis "O’ the Mysteries of Colorado" (CC BY-NC 2.0) by WarzauWynn
  • 16.
  • 17.
  • 22.
  • 23.
  • 25. Catalog Cust 1 Cust 2 Cust 3 Cust N 2. App uses key to get connection from catalog Tenant Databases 4. On subsequent requests, use a cache! Tenant Catalog 1. User connects to the app Selfservice tenant creation and destruction A. User signs up for a new tenant Cust 4 B. App provisions new tenant db C. …registers tenant key, db location in catalog 3. …then connects to correct tenant database ARM / SQL Database Tenant Onboarding Application Connection Base TenantDB Tenant bacpac Apps
  • 26. Catalog Cust 1 Cust 2 Cust 3 Cust N Tenant Databases Tenant Catalog More simple approach: no selfservice Apps Management scripts AAD
  • 27. So…. what do I need? "tools" (CC BY-NC-ND 2.0) by ᴾᴴᴵᴸ
  • 28. Individually unpredictable share resources Collectively stable and predictable Cost effective, scale pool up/down based on trends Expensive, must provision each db for peaks Pools are cost-effective for unpredictable workloads
  • 29. Elastic pool usage example 385 dbs in 200 DTU pool, per-database max at 100 DTUs
  • 31. Elastic Database Client Library using (SqlConnection conn = customerShardMap.OpenConnectionForKey( customerId, Configuration.GetCredentialsConnectionString(), ConnectionOptions.Validate)) { // Execute a simple command. SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = @"UPDATE Sales.Customer …."; // … and more boring stuff .. }
  • 32. Elastic Transactions using (var scope = new TransactionScope()) { using (var conn1 = new SqlConnection(connStrDb1)) { // … boring stuff … } using (var conn2 = new SqlConnection(connStrDb2)) { // … boring stuff } scope.Complete(); }
  • 33. Cust 1 Cust 2 Cust 3 Cust N Schema management at scale Cust 4 Catalog Manage 1000s of databases as one Apps T-SQLT-SQLT-SQL T-SQLT-SQL Azure Portal Job Account T-SQL CREATE TABLE… CREATE INDEX… INSERT INTO… SELECT * FROM… T-SQL Job SELECT * FROM… Elastic Jobs Tenant Databases Tenant Catalog Jobs, target groups, schedules, credentials
  • 34. Cust 1 Cust 2 Tenant Databases Cust 3 Cust N Distributed query across tenant databases Tenant Catalog Adhoc Analytics Cust 4 Catalog Database locations are retrieved from catalog Distributed query plan External tables project data from tenant dbs PowerBI Query from any client Query all tenants as if they are in a single database Apps Elastic Query
  • 36.
  • 37. Standalone App Database per tenant Sharded Multi-tenant Scale High 1-1000s Very high 1-100,000s Unlimited 1-1,000,000s Database cost–per tenant High (sized for peaks) Low (using pools) Lowest (small tenants) Tenant isolation Very High High Low (high for singletons) Performance monitoring/mgt. Per-tenant Aggregate + per-tenant Aggregate, per-tenant for singletons only Restore single tenant Easy Easy Hard (easy for singletons) Disaster recovery (all tenants) Moderate Many components to recover Moderate Patterns address complexity at scale Easy (for multi-tenant dbs) Patterns address singleton complexity at scale Development complexity Low Low Medium (sharding) Operational complexity Medium-High Individually simple, complex at scale Low-Medium Patterns address complexity at scale Low-High Individual tenant management is complex Per-tenant customization Easy Easy Complex Comparing the models, what we see…
  • 38.
  • 39. DO TRY THIS AT HOME! HENRY BEEN Independent Devops & Azure Architect E: consultancy@henrybeen.nl T: @henry_been L: linkedin.com/in/henrybeen W: henrybeen.nl

Editor's Notes

  1. Licence notice for those parts I copied in from the WingTips presentations MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
  2. https://www.tubefilter.com/2018/08/20/twitch-private-messages-bug/ https://help.twitter.com/en/account-activity-api
  3. "O’ the Mysteries of Colorado" (CC BY-NC 2.0) by WarzauWynn
  4. The Masterplan
  5. The Masterplan
  6. Image from Wikipedia, https://upload.wikimedia.org/wikipedia/commons/c/ca/DART_UML_DART_2011_2013_RAW.svg
  7. "tools" (CC BY-NC-ND 2.0) by ᴾᴴᴵᴸ
  8. Real telemetry from an accounting customer’s set of pools (when this data was recorded they had over 300 pools, and each pool had nearly 400 databases sharing 200 DTUs). As you can see, their aggregate tenant workload is easily supported by 200 DTU pool. [The pool at 200 DTUs is twice the per-database max of 100 DTUs so would allow 2 databases to be active]
  9. https://github.com/Microsoft/WingtipTicketsSaaS-DbPerTenant