SlideShare a Scribd company logo
1 of 30
Download to read offline
DATABASE
MULTITENANCY
RUBY IDIOM CASE
TYPICAL MULTITENANCY OPTIONS
SQL WORLD
SHARED
Same Database
Different Schema
ISOLATED
TYPICAL MULTITENANCY OPTIONS
SQL WORLD
SHARED
Same Database
Different Schema
Different Database
Same Schema
ISOLATED
TYPICAL MULTITENANCY OPTIONS
SQL WORLD
SHARED
Same Database
Different Schema
Different Database
Same Schema
Different Database
Different Schema
ISOLATED
TYPICAL MULTITENANCY OPTIONS
SQL WORLD
SCHEMA-LESS WORLD - MONGODB
SHARED
Same Database
Different Schema
Different Database
Same Schema
Different Database
Different Schema
ISOLATED
SHARED
Same Database
Different Collection
ISOLATED
TYPICAL MULTITENANCY OPTIONS
SQL WORLD
SCHEMA-LESS WORLD - MONGODB
SHARED
Same Database
Different Schema
Different Database
Same Schema
Different Database
Different Schema
ISOLATED
SHARED
Same Database
Different Collection
Different Database
Different Collection
ISOLATED
Reference: Considerations on MongoDB multitenancy blog post
MONGODB
SETUP TENANT DATABASE
▸ Create Database
▸ Create collections
▸ Shard collections
▸ Define shard keys
▸ Set tagged ranges
▸ Create indices
▸ Seed with initial data
Building on top of Mongoid
Building on top of Mongoid
Building on top of Mongoid
PROS AND CONS
PROS
Rack compliant
PROS AND CONS
PROS
Rack compliant
No one needs to care
PROS AND CONS
PROS
Rack compliant
No one needs to care
Isolates multitenancy implementation to a single method
PROS AND CONS
PROS
Rack compliant
No one needs to care
Isolates multitenancy implementation to a single method
If something goes wrong it ensures it goes back to the default
PROS AND CONS
PROS
Rack compliant
No one needs to care
Isolates multitenancy implementation to a single method
If something goes wrong it ensures it goes back to the default
CONS
Always need to define the database for maintenance tasks
PROS AND CONS
PROS
Rack compliant
No one needs to care
Isolates multitenancy implementation to a single method
If something goes wrong it ensures it goes back to the default
CONS
Always need to define the database for maintenance tasks
Need to store the tenant database name somewhere else
PROS AND CONS
PROS
Rack compliant
No one needs to care
Isolates multitenancy implementation to a single method
If something goes wrong it ensures it goes back to the default
CONS
Always need to define the database for maintenance tasks
Need to store the tenant database name somewhere else
You need to be ready to not have the database setup right away
REAL WORLD
ADVANTAGES
▸ Performance not affected by other customers data growth
▸
REAL WORLD
ADVANTAGES
▸ Performance not affected by other customers data growth
▸ Easier to perform data migrations for single customers
REAL WORLD
ADVANTAGES
▸ Performance not affected by other customers data growth
▸ Easier to perform data migrations for single customers
▸ Delete old customers data is a simple DROP DATABASE
REAL WORLD
ADVANTAGES
▸ Performance not affected by other customers data growth
▸ Easier to perform data migrations for single customers
▸ Delete old customers data is a simple DROP DATABASE
GOTCHAS
▸ You are on your own, no support, no one will care about if creating a
database is slow or listing them takes ages (MongoDB Cloud Manager)
REAL WORLD
ADVANTAGES
▸ Performance not affected by other customers data growth
▸ Easier to perform data migrations for single customers
▸ Delete old customers data is a simple DROP DATABASE
GOTCHAS
▸ You are on your own, no support, no one will care about if creating a
database is slow or listing them takes ages (MongoDB Cloud Manager)
▸ Monitoring tools like New Relic discard database information when
showing query performance metrics
YOU CAN JOIN US
WE ARE HIRING
▸ Backend
▸ Frontend
▸ Mobile iOS/Android
TALK TO ME
https://github.com/lqd-io
ME
JOÃO SOARES
@_jasoares
github.com/jasoares
linkedin.com/in/jaisoares
CTO & Cofounder @ Liquid
Previously:
Mobitto
Way2Inov
ASK ME ANYTHING

More Related Content

What's hot

Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionindiver
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsHabilelabs
 
Mongo Seattle - The Business of MongoDB
Mongo Seattle - The Business of MongoDBMongo Seattle - The Business of MongoDB
Mongo Seattle - The Business of MongoDBJustin Smestad
 
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)Ortus Solutions, Corp
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaEdureka!
 
WiredTiger Overview
WiredTiger OverviewWiredTiger Overview
WiredTiger OverviewWiredTiger
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009Mike Dirolf
 
Sql server 2014 what's new-
Sql server 2014  what's new-Sql server 2014  what's new-
Sql server 2014 what's new-Stuart Ainsworth
 
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...MongoDB
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDBAlex Sharp
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - IsraelMichael Fiedler
 
Postgres seminar
Postgres seminarPostgres seminar
Postgres seminarmahsanaru
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLCOSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLLen Chang
 

What's hot (20)

Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusion
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
Mongo Seattle - The Business of MongoDB
Mongo Seattle - The Business of MongoDBMongo Seattle - The Business of MongoDB
Mongo Seattle - The Business of MongoDB
 
SQL & NoSQL
SQL & NoSQLSQL & NoSQL
SQL & NoSQL
 
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
 
Introduction to mongoDB
Introduction to mongoDBIntroduction to mongoDB
Introduction to mongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
 
WiredTiger Overview
WiredTiger OverviewWiredTiger Overview
WiredTiger Overview
 
Cosmos db
Cosmos dbCosmos db
Cosmos db
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009
 
Sql server 2014 what's new-
Sql server 2014  what's new-Sql server 2014  what's new-
Sql server 2014 what's new-
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
 
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - Israel
 
Postgres seminar
Postgres seminarPostgres seminar
Postgres seminar
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLCOSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
 

Similar to Multitenancy options for MongoDB databases

MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptxSigit52
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabasesAdi Challa
 
001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introductionScott Miao
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLbalwinders
 
Your data layer - Choosing the right database solutions for the future
Your data layer - Choosing the right database solutions for the futureYour data layer - Choosing the right database solutions for the future
Your data layer - Choosing the right database solutions for the futureObjectRocket
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionBrian Enochson
 
Real World NoSQL (by Chris Yuen)
Real World NoSQL (by Chris Yuen)Real World NoSQL (by Chris Yuen)
Real World NoSQL (by Chris Yuen)orcsab
 
Tech-Spark: Scaling Databases
Tech-Spark: Scaling DatabasesTech-Spark: Scaling Databases
Tech-Spark: Scaling DatabasesRalph Attard
 
Introducing Azure Databases
Introducing Azure DatabasesIntroducing Azure Databases
Introducing Azure DatabasesGrant Fritchey
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With LiquibaseIASA
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with LiquibaseTim Berglund
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDBvaluebound
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDBMongoDB
 
MongoDB introduction
MongoDB introductionMongoDB introduction
MongoDB introductionEdward Yoon
 

Similar to Multitenancy options for MongoDB databases (20)

MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
NoSQL
NoSQLNoSQL
NoSQL
 
Mongodb
MongodbMongodb
Mongodb
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Data
DataData
Data
 
Your data layer - Choosing the right database solutions for the future
Your data layer - Choosing the right database solutions for the futureYour data layer - Choosing the right database solutions for the future
Your data layer - Choosing the right database solutions for the future
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
 
No SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability MeetupNo SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability Meetup
 
Real World NoSQL (by Chris Yuen)
Real World NoSQL (by Chris Yuen)Real World NoSQL (by Chris Yuen)
Real World NoSQL (by Chris Yuen)
 
Tech-Spark: Scaling Databases
Tech-Spark: Scaling DatabasesTech-Spark: Scaling Databases
Tech-Spark: Scaling Databases
 
Introducing Azure Databases
Introducing Azure DatabasesIntroducing Azure Databases
Introducing Azure Databases
 
mongo db EMERSON EDUARDO RODRIGUES
mongo db EMERSON EDUARDO RODRIGUESmongo db EMERSON EDUARDO RODRIGUES
mongo db EMERSON EDUARDO RODRIGUES
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With Liquibase
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
MongoDB introduction
MongoDB introductionMongoDB introduction
MongoDB introduction
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Multitenancy options for MongoDB databases

  • 2. TYPICAL MULTITENANCY OPTIONS SQL WORLD SHARED Same Database Different Schema ISOLATED
  • 3. TYPICAL MULTITENANCY OPTIONS SQL WORLD SHARED Same Database Different Schema Different Database Same Schema ISOLATED
  • 4. TYPICAL MULTITENANCY OPTIONS SQL WORLD SHARED Same Database Different Schema Different Database Same Schema Different Database Different Schema ISOLATED
  • 5. TYPICAL MULTITENANCY OPTIONS SQL WORLD SCHEMA-LESS WORLD - MONGODB SHARED Same Database Different Schema Different Database Same Schema Different Database Different Schema ISOLATED SHARED Same Database Different Collection ISOLATED
  • 6. TYPICAL MULTITENANCY OPTIONS SQL WORLD SCHEMA-LESS WORLD - MONGODB SHARED Same Database Different Schema Different Database Same Schema Different Database Different Schema ISOLATED SHARED Same Database Different Collection Different Database Different Collection ISOLATED Reference: Considerations on MongoDB multitenancy blog post
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. MONGODB SETUP TENANT DATABASE ▸ Create Database ▸ Create collections ▸ Shard collections ▸ Define shard keys ▸ Set tagged ranges ▸ Create indices ▸ Seed with initial data
  • 12. Building on top of Mongoid
  • 13. Building on top of Mongoid
  • 14. Building on top of Mongoid
  • 15.
  • 17. PROS AND CONS PROS Rack compliant No one needs to care
  • 18. PROS AND CONS PROS Rack compliant No one needs to care Isolates multitenancy implementation to a single method
  • 19. PROS AND CONS PROS Rack compliant No one needs to care Isolates multitenancy implementation to a single method If something goes wrong it ensures it goes back to the default
  • 20. PROS AND CONS PROS Rack compliant No one needs to care Isolates multitenancy implementation to a single method If something goes wrong it ensures it goes back to the default CONS Always need to define the database for maintenance tasks
  • 21. PROS AND CONS PROS Rack compliant No one needs to care Isolates multitenancy implementation to a single method If something goes wrong it ensures it goes back to the default CONS Always need to define the database for maintenance tasks Need to store the tenant database name somewhere else
  • 22. PROS AND CONS PROS Rack compliant No one needs to care Isolates multitenancy implementation to a single method If something goes wrong it ensures it goes back to the default CONS Always need to define the database for maintenance tasks Need to store the tenant database name somewhere else You need to be ready to not have the database setup right away
  • 23. REAL WORLD ADVANTAGES ▸ Performance not affected by other customers data growth ▸
  • 24. REAL WORLD ADVANTAGES ▸ Performance not affected by other customers data growth ▸ Easier to perform data migrations for single customers
  • 25. REAL WORLD ADVANTAGES ▸ Performance not affected by other customers data growth ▸ Easier to perform data migrations for single customers ▸ Delete old customers data is a simple DROP DATABASE
  • 26. REAL WORLD ADVANTAGES ▸ Performance not affected by other customers data growth ▸ Easier to perform data migrations for single customers ▸ Delete old customers data is a simple DROP DATABASE GOTCHAS ▸ You are on your own, no support, no one will care about if creating a database is slow or listing them takes ages (MongoDB Cloud Manager)
  • 27. REAL WORLD ADVANTAGES ▸ Performance not affected by other customers data growth ▸ Easier to perform data migrations for single customers ▸ Delete old customers data is a simple DROP DATABASE GOTCHAS ▸ You are on your own, no support, no one will care about if creating a database is slow or listing them takes ages (MongoDB Cloud Manager) ▸ Monitoring tools like New Relic discard database information when showing query performance metrics
  • 28. YOU CAN JOIN US WE ARE HIRING ▸ Backend ▸ Frontend ▸ Mobile iOS/Android TALK TO ME https://github.com/lqd-io