I’ve got a WordPress multisite installation that’s hosting enough blogs I need to shard the database. I see there are three plugins available to spread WordPress across multiple databases:
- http://wordpress.org/extend/plugins/hyperdb/
- http://premium.wpmudev.org/project/multi-db
- http://wordpress.org/extend/plugins/shardb/
I’m trying to decide which one to use, but I haven’t really found much info comparing them.
Does anyone have experience deploying any of these three tools? Or better yet, experience with more than one of them and a rundown of why you switched?
Thanks, Bethany
Personally, I use none of them. And an NDB cluster instead. NDB is MySQL’s built-in master-master replication engine.
The only limitation of NDB in practice is the lack of full text index. But you can always use yahoo or google’s API for searches within your site. I found it worth the extra redundancy, especially when considering that no server ends up being a db write bottle neck.
If master-slave replication with a write bottle neck is what you need, hyperdb is developed by automattic, so it’s the safer bet among the plugins you highlighted. That said, note that part of the hyperdb code is actually back ported into wp since 3.0 and the wpmu merge. (See the wp-db.php file in wp-includes, you’ll notice a lot of it can handle multiple db servers out of the box.)
I would go with HyperDB.
It’s developed by core WP developers and based on code used at WordPress.com.
http://wordpress.org/support/topic/shardb-or-hyperdb
SharDB might be a little easier to setup but probably has less features than HyperDB. I’d say take a look at those two and figure out which one best matches your needs.
Matt spoke at our company a few months ago. He recommended a master-slave DB setup with many R/O slaves. His rationale was that writes were expensive and reads—much higher in volume!—were not, so it was better to have more read capacity. Ditto for app servers: throw cheap hardware at the issue and forget about supercache.