[wp-hackers] State of WP

Donncha O Caoimh donncha at linux.ie
Mon Apr 9 19:43:24 GMT 2007

Dr. Mike Wendell wrote:
> On 4/9/07, Kevin McCann <kmccann at cruciverb.com> wrote:
>> - each site would have its 8 uniquely-prefixed tables. Times that by
>> 100,000 or possibly much more... anyone know if this'll be a problem for
>> MySQL?
> Yup.  Big problem.  Each of those tables consist of three files within
> the MySQL database so you would be looking at 2.4million database
> files.  A normal Linux directory can hold at most 32k files.  There
> are those with multi database setups but all of them are sitting on
> their solutions and not releasing them to the community.  It's doable
> but you'd have to figure how how to do it yourself.

This has been explained several times on the MU forums, but for a quick
recap, the simplest way to use multiple databases is by running the
blog_id through md5 and grabbing the first 3 characters. This gives you
a possible 4096 databases, so create that number of databases which is
where we'll store the data for individual blogs.
We also need a global db for things like wp_blogs, wp_usermeta and other
"global" tables.
So, when a query comes in, if it's a global db query then send it there,
otherwise grab the blog_id from the query, or simply use $wpdb->blogid,
find the right db and send the query to that db.

Things get a little more complicated when you have master and slave
databases, and get scary when you partition the data over multiple servers.

Here's the Trac ticket for that little job, anyone want to submit a
patch? http://trac.mu.wordpress.org/ticket/250

>> - am I wrong in having the impression that many plug-ins don't work with
>> WPMU? I tried Role Manager (I need to create new roles) but it doesn't

drmike's right, most plugins do actually work, and the
themes I've thrown at it do too. The ones that don't are the ones which
haven't been updated to cope with the WP2.1 API.

PS. resending hours later, the original got eaten!

More information about the wp-hackers mailing list