Go Back   NuHIT - SEO, Wiki, Forums > Wiki

Database considerations

From Wiki

Contents

[edit] Database Considerations

When installing MediaWiki and vBulletin on your site there are several configurations that can be used:

  • Both systems installed on the same database, with different 'table prefixes'. (This is the setup used here at nuhit.com)
  • Both systems installed on the same server, but different databases.
  • Both systems installed on different servers.
  • Multiple databases hosted on different servers.


vbWiki Pro will work with any of these configurations.


Disclaimer: The following statements express my opinion on this matter. I am sure that there are others with different ideas. If you feel that you can add to these statements click the edit button above. If you have different ideas click the discussion button above, and let's discuss.. :-)


Summary: If you are not using multiple servers or do not plan on growing out of your current server in a reasonable amount of time (e.g. 1-2 years), then most likely you should go with the single database setup.


[edit] Backup Strategy points to consider

It is always good to have a backup strategy in place. A good backup strategy includes, amongst other, the following elements:

  • Regular scheduled backups to another server (at least once a day, or more often depending on traffic),
  • Regular off-site backups as a measure for disaster-recovery (e.g. once a week).
  • Keeping the backups for the last x days (or weeks or months); older backups are discarded. This is done just in case something happened in that period (spam, data corruption, data loss) and your latest backups are compromised. (Imagine that your scheduled backup runs at 4:00 AM, and at 3:50 AM your site is hacked.)
  • In some cases, depending on the nature of the data, in addition to the backups kept in the point above, you also keep a 'sampling' of older backups. For instance, let's say that your backup strategy keeps the backups for the last week. Older backups are regularly discarded, except that you keep one backup per week (or per month, etc).


While backup strategies is not the purpose of this article, these are important points to keep in mind when deciding on how to install vBulletin and MediaWiki together in your community.


[edit] Single vs. Separate Databases on the same server

Performance-wise there is no (or little) difference between having 1 database and having 2 databases in the same server.


The main considerations when deciding between these two alternatives is what works better for you from a backup perspective.


[edit] The case for single database on the same server

If you are going to backup both systems at the same time, then it is more convenient to have to deal with a single database. One database to backup, one file to compress, one file to transfer.


It is also easier to manage your backups storage (where you keep the backups for the last x days/week/months). If you keep your daily backups for the last 7 days, then having both vBulletin and MediaWiki installed on the same database will let you deal with only 7 backup files (rather than 14).


[edit] The case for multiple databases on the same server

If you plan on backing up the two systems (vB and MW) at different schedules, then it would be better two separate DBs. While it is possible to do this even on the 'single database setup', it is easier if the databases are separate.


Another aspect to consider is the resulting size of your compressed backup files. If your databases are big, even when your backups are compressed, then managing two 'smaller' backup files, may be easier than one that is 'big'.


In this case, having two compressed backup files (one for each database) makes it easier (in theory) for over-the-network transfer, as well as for burning into a DVD or tape.


Maybe more important that the points above is your database growth projections. If you have a high traffic community, then you should evaluate the rate at which your database and server load have been increasing. Based on this rate you can project (with some level of accuracy) when your community will need to branch out to multiple servers.


If your community will need a new server in, let's say, 6 months, then you should already be considering your expansion path, and you should install your MediaWiki database separate from vBulletin.


If your community will need a new server in 1 or 2 years, then you should evaluate the pros and cons between the single and multiple database setups.


[edit] Separate Databases in Single vs. Separate Server or Multiple DB Servers

The main points to consider when deciding between one or two servers are the same points discussed above.


If you feel that you need to have MediaWiki's database hosted on a separate server from your vBulletin database, then most likely you are right.


There will come a point where even having one server per database is not enough, but you will know when this is necessary, and if you are at this point... congrats!


[edit] Is it possible to use the single database setup now, and later move to multiple databases?

The short answer is yes. You can install vBulletin and MediaWiki on the same database, and when the time comes you can separate them into two databases.


You can always select a set of tables to be backed up, and then restored in another database/server.


[edit] Table prefixes during installation

If you use different table prefixes for vBulletin and MediaWiki (e.g. all vBulletin table names start with vb_, and all MediaWiki tables start with wk_), then it is easy to manage and migrate your database.


If this rule is followed, then it is easy to select all vb_* (or whatver prefix is chosen) tables and move them to another server.


When installing MediaWiki, you can specify a table prefix in the installation script.


Find the field labeled 'Database Table prefix', towards the bottom of the form and enter the prefix you would like to use (e.g. wk_, mw_, wiki_). Usually the table prefixes are 2 or 3 letters long, and ending on an underscore, for readability's sake.


All times are GMT -4. The time now is 10:12 PM.