Should I use multiple databases?
Posted: Thu Oct 25, 2007 2:27 pm
I'm going to gather data which I will need in multiple websites hosted on the same server. The data is very general; f.e. country codes and their names in different languages. The data will only be updated by use of a script which requests the data from other servers (which might be down or slow sometimes which is why I need to keep it locally).
I'm now doubting which structure to use in order to have as little difficulties as possible maintaining the data. Some options I'm considering are:
- Adding a seperate database and connecting to it when needed.
Advantages: Data is always up-to-date and doesn't need to be synchronized
Disadvantages: Multiple database connections needed for a single website
- Adding a seperate database and exporting it regularly
Advantages: Single connection per website
Disadvantages: Requires manual work
- Some kind of API which returns the needed data in XML format
Advantages: Single connection per website, Data is always up-to-date and doesn't need to be synchronized
Disadvantages: Requires a lot of effort to build
- Having tables in all databases and have these updated by a seperate script
Advantages: Only the script requires multiple DB connections
Disadvantages: Table structure modifications will have to be made twice
What would you do?
I'm now doubting which structure to use in order to have as little difficulties as possible maintaining the data. Some options I'm considering are:
- Adding a seperate database and connecting to it when needed.
Advantages: Data is always up-to-date and doesn't need to be synchronized
Disadvantages: Multiple database connections needed for a single website
- Adding a seperate database and exporting it regularly
Advantages: Single connection per website
Disadvantages: Requires manual work
- Some kind of API which returns the needed data in XML format
Advantages: Single connection per website, Data is always up-to-date and doesn't need to be synchronized
Disadvantages: Requires a lot of effort to build
- Having tables in all databases and have these updated by a seperate script
Advantages: Only the script requires multiple DB connections
Disadvantages: Table structure modifications will have to be made twice
What would you do?