SlideShare a Scribd company logo
Buidling a multi-tenant
application using 50k databases
Henry Been
ROME - APRIL 13/14 2018
Scale up
Scale out
Server 1 Server 2 Server 3 Server 4 Server n
Database
loadbalancing
WHY?
1 question:
Why only a single database?
•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
Server 1 Server 2 Server 3 Server 4 Server n
DB
loadbalancing
DB DB DB DB DB
Using a database per tenant
•Unlimited scaleability
•Isolation of failure
•Roughly 2,5 times cheaper
•100% tenant isolation
•Better fit for legacy applications
100% tenant isolation
•Snapshot backup/restore
•Recover to point in time
•Compliance
•Limited authorization risks
Better fit for legacy applications
•Designed for single tenant, single db
•Allows for move to the cloud
•Use case I will present
Disclaimer!
"The Long Road Ahead" (CC BY-NC-ND 2.0) by CC Chapman
SnelStart
How it happened at
"Incidental Expenses" (CC BY-NC 2.0) by tim ellis
SnelStart
A
SnelStart
AA
SnelStart
SnelStart
A
Web-
application A
SnelStart
SnelStart
Web-
application A
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Cost-efficiency: elastic pools
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018
So…. what do I need?
"tools" (CC BY-NC-ND 2.0) by ᴾᴴᴵᴸ
Services platform
•Login
•Retrieve connection string
•Create tenant
•Destroy tenant
•Backup tenant
•Restore tenant
Catalog
•Customers / Accounts
•Users
•Tenants
•Authorizations
•Operations
• Create / destroy
• Backup/restore
• Etc
User
Directory
A pointer on operations
•Modeled as a state machine, with steps
•Designed for failure and resume
•Properties
•Retry
•Idempotentcy
•Reentrant
•Queue vs. database
User
Directory
A lighter implementation
User
Directory
Demo time!
"Mad Science!" (CC BY-NC 2.0) by FallenPegasus
Wich way forward?
•Unlimited scaleability
•Isolation of failure
•Migration of legacy
•More effort to build!
Wich way forward?
"Balanced Stones.Sausalito" (CC BY-SA 2.0) by DrPleishner
HENRY BEEN
Independent geek
E: consultancy@henrybeen.nl
T: @henry_been
L: linkedin.com/in/henrybeen
W: henrybeen.nl
Do try this at home!

More Related Content

PDF
BlazeMeter Presents at the High Performance Drupal Meetup
PPTX
Aws 12 Month Free Tier for Web Designers and Developers
PPTX
How to Build High Performance : WordPress
PPTX
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
ODP
Zero Downtime JEE Architectures
PDF
Journey towards serverless infrastructure
PDF
Custom coded projects
PPTX
What to consider when monitoring microservices
BlazeMeter Presents at the High Performance Drupal Meetup
Aws 12 Month Free Tier for Web Designers and Developers
How to Build High Performance : WordPress
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime JEE Architectures
Journey towards serverless infrastructure
Custom coded projects
What to consider when monitoring microservices

What's hot (19)

PPTX
Building a PaaS with Docker and AWS
PPTX
Cloud patterns
PPTX
Containerization: The DevOps Revolution
PPTX
Modern Cloud Fundamentals: Misconceptions and Industry Trends
PPTX
Immutable Infrastructure: the new App Deployment
PDF
Bosh - Configuring Services
PPTX
Elixir Processes
PPTX
Blue green deployment
PPTX
Breaking the Speed Limit: Faster Websites Win
PPTX
Perf 101-lab-slideshare
PDF
Dcpl cloud computing amazon fail
PPTX
Windows Azure Zero Downtime Upgrade
PDF
Open analytics meetup alex poon (1)
PDF
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
PPTX
OSCON2014: Understanding Hypervisor Selection in Apache CloudStack
PPT
Enterprise Beacon Object Hive - Siebel Version Control
PDF
[Christopher Ngo] Intro DevOPS XP Day 2015
PDF
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
PPTX
Scaling Systems: Architectures that Grow
Building a PaaS with Docker and AWS
Cloud patterns
Containerization: The DevOps Revolution
Modern Cloud Fundamentals: Misconceptions and Industry Trends
Immutable Infrastructure: the new App Deployment
Bosh - Configuring Services
Elixir Processes
Blue green deployment
Breaking the Speed Limit: Faster Websites Win
Perf 101-lab-slideshare
Dcpl cloud computing amazon fail
Windows Azure Zero Downtime Upgrade
Open analytics meetup alex poon (1)
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
OSCON2014: Understanding Hypervisor Selection in Apache CloudStack
Enterprise Beacon Object Hive - Siebel Version Control
[Christopher Ngo] Intro DevOPS XP Day 2015
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Scaling Systems: Architectures that Grow
Ad

Similar to Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018 (20)

PPTX
Cloud brew cloudcamp
PPTX
“Salesforce Multi-tenant architecture”,
PPTX
Multi Tenancy In The Cloud
PDF
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
PPTX
Multi-Tenancy
PPTX
What is Multi-Tenant Architecture ?
PPTX
Software as a service
PPTX
One App, Many Clients: Converting an APEX Application to Multi-Tenant
PPTX
Create scalable and configurable multi tenancy application
PDF
Multitenant applications: How and Why
PDF
Database Multitenancy in Ruby
PPTX
Multi tenancy - Wining formula for a PaaS
PPTX
Tenants: A Look Behind the Scenes
PDF
Multi-tenancy in Java
PDF
Building a multitenant application with Django
PPTX
SaaS transformation with OCE - uEngineCloud
PPTX
Multi tenant architecture
PPTX
Multi-tenancy: Winning formula for a PaaS
PDF
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
PDF
Comparing Single-Tenant and Multi-Tenant Cloud Architectures
Cloud brew cloudcamp
“Salesforce Multi-tenant architecture”,
Multi Tenancy In The Cloud
Schema-based multi-tenant architecture using Quarkus & Hibernate-ORM.pdf
Multi-Tenancy
What is Multi-Tenant Architecture ?
Software as a service
One App, Many Clients: Converting an APEX Application to Multi-Tenant
Create scalable and configurable multi tenancy application
Multitenant applications: How and Why
Database Multitenancy in Ruby
Multi tenancy - Wining formula for a PaaS
Tenants: A Look Behind the Scenes
Multi-tenancy in Java
Building a multitenant application with Django
SaaS transformation with OCE - uEngineCloud
Multi tenant architecture
Multi-tenancy: Winning formula for a PaaS
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Comparing Single-Tenant and Multi-Tenant Cloud Architectures
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Modernizing your data center with Dell and AMD
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Modernizing your data center with Dell and AMD
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Unlocking AI with Model Context Protocol (MCP)

Building a multi-tenant application using 45.000 databases - Henry Been - Codemotion Rome 2018

Editor's Notes

  • #11: Image from Wikipedia, https://upload.wikimedia.org/wikipedia/commons/c/ca/DART_UML_DART_2011_2013_RAW.svg Dislaimer: What I will be sharing, applies best to traditional upscaling relational databases Less to infinity scaling databaes like DynamoDB or CosmosDB
  • #12: Image from: "The Long Road Ahead" (CC BY-NC-ND 2.0) by CC Chapman The rest of this 40 minutes: Introduction of one of the largest use cases in the world Introduction of two variations of this partern How to go about designing such a solution
  • #14: "Incidental Expenses" (CC BY-NC 2.0) by tim ellis
  • #17: The Masterplan
  • #18: The Masterplan
  • #20: By now you might want to say, whut? That database is used by only 1 or 2 users? Isn’t that idle half the time? Nope! Actually it is idle 99% of the time. So, how can that be cost effective?
  • #22: This and next five images from MSDN, Microsoft – with permission
  • #28: "tools" (CC BY-NC-ND 2.0) by ᴾᴴᴵᴸ
  • #31: Actually the architecture is more complex than first shown - Showing more services used on the back-end
  • #38: Actually the architecture is more complex than first shown - Showing more services used on the back-end
  • #39: Addeda gain: for comparision
  • #40: "Mad Science!" (CC BY-NC 2.0) by FallenPegasus
  • #41: "Keep Moving Forward" (CC BY 2.0) by IrfaanPhotography
  • #43: "Balanced Stones.Sausalito" (CC BY-SA 2.0) by DrPleishner