As the community knows me that I'm not a PHP Developer by core, but trying to be one. With the company I'm working, I developed many WordPress powered News Portals, where-

  • They publish at least 30 - 50 posts per day with/without Images
  • Articles contain several Custom Fields
  • Publishes advertisement on the site using plugins
  • Use 3 - 4 Plugins for different benefits that stores data into db

I's talking to one of my non-WP PHP Developer about the future of such sites, he pointed me to an issue I'm thinking afterwards.

Each and everyday the data load is increasing and the database is getting more bigger. So he suggested a process using Cron-like things to move a Part of the database to an archive. So the process will run automatically and the main database will become light. The idea is to be:

  • Browsing http://example.com/ will hit database db_example by core
  • Browsing http://example.com/ for a news older than 365days will hit database db_archive_1 that is an automated separated part of the db_example.

The schedule can run like:
Transfer all the data that is older than 365days from db_example to db_archive_1.

It should be that automated and that fast that if a user browse the news, he/she won't ever be understand that it's coming from an already split database.

There are many question in my mind, as I'm in blank point, don't even know how to do this:

  • How can that be possible?
  • If it is possible than I have recent news on main db, but 365days-older-news in archive db — so there are two different databases to a single project; how to connect/manage them?
  • Or, the most importantly first, is that actually necessary?

The last question arises, because recently I worked on a Government Portal that is a huge project maintained with Drupal (I din't develop that, but I maintained the domain-mapped portal), and it's storing all its data to a single database. And the database has already exceeded several GB. Though taking backup etc. has become an issue there, otherwise the system is running smooth. And with Drupal's built-in cache, the front-end is smooth too.
So, in reality, is the splitting necessary?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.