Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One database or many for multicountry web application

let's get some different points of view about this situation I have.

I'm creating a (asp.net) web application with database (sql server express, max 10gb db size).

This application manages entities but entities are related to countries, one country - many entities.

Before anything, I can't predict how the db is going to grow. This is a personal/hobby project I'm doing in my free time.

My concerns are if I should create a specific copy of the database per country. My reasons to think that are:

  • Size of the databases will be smaller, so I won't have problems of size starting with the SQL Server Express.
  • Again, the db size. As it is smaller per country, performance will be better.
  • Can do maintenance tasks (backups, deployments) at low peak time for every country.
  • In case of different laws about protecting data per country I can adapt each db to the specific law.
  • Customized text search per country. This is not a problem really because i think I could create a view per different country and do text search of that view.

Then, if I have only one database for all the countries there are some advantages:

  • Maintenance is going to be simpler. Only one database means doing things just once.
  • No reduntant code. I use Stored Procedures a lot of this web app. One change would only need to be published once in production.

God! writing down pros of each alternative seems to make multiple database a winner! It seems that single database is for lazy people...

Anyway, I'd like to read more points of view, so please guys, feel free to contribute with your thinkings. Thanks!

like image 270
Alfonso Muñoz Avatar asked Jan 20 '26 07:01

Alfonso Muñoz


1 Answers

I would choose 1 database.

For the easier maintenance work. There are almost 200 countries in the world, even if you have a database for half of them. The day you want to add a column to a table and you have to change it in every database is going to be a nightmare.(making sure you don't forget 1 database or if you mistype the name, etc).

Also, with the power/capacity of current computers, performance shouldn't be a problem. (unless it's very important for your program).

like image 120
Oliver Avatar answered Jan 23 '26 05:01

Oliver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!