Home > Back-end >  When to Create DB and When to Create Schema
When to Create DB and When to Create Schema

Time:09-10

This seems a design question but I wanted to know if there is a pattern or design consideration we need to have where we would want to create a Database and not a new schema.

why not create one big database and separate schemas. Under what circumstance should we create a new database.

CodePudding user response:

They are just logical divisions, so for the most part it's a matter of preference. There is one place where it's not a matter of preference: replication.

As of September, 2022, the unit of replication is the database. It's possible to specify which databases you want to replicate, but not which schemas within a database to replicate.

If you plan to replicate, you'll want to think about keeping only the schemas/tables that are important to replicate in one or more databases that get replicated and keep other data in databases that do not get replicated.

CodePudding user response:

Another thought could be, In a large DWH Enterprise Solution,

There can be variety of flavours of tables which You can map to different databases. Sales DB, Master DB, Finance DB for ex. Then Inside DBs, You may want to have schemas for tables, views ,procedures and other object .

  • Related