[wp-hackers] MUlti-DB setup - An alternative approach that i handled.

Beau Lebens beau at dentedreality.com.au
Tue Mar 31 17:16:57 GMT 2009


There is a plugin available that would probably be a better way of
handling this (since it doesn't involve hacking the core code at all).

WordPress.com uses it, so it's known to handle millions of
users/blogs. Oh, and it has a really cool name :) HyperDB!

http://codex.wordpress.org/HyperDB

HTH


On Tue, Mar 31, 2009 at 1:54 AM, technocraze <technocraze at gmail.com> wrote:
> Hi,
>
> Recently, while upgradation of our wordpress code base, from nightly build
> (released in 2006) and i tried a different approach to implement multi-db
> setup.  We had around 10,000 blogs in the old setup, with more than 1 lakh
> tables
>
> In the current setup, the table variables in $wpdb is initialised to tables
> along with prefix.  I hacked that part of code, and in turn initialised
> these variables, along with DB name.  By this in all queries, the DB name
> will also be included along with the table name.
> I used the migration script of mutli-db plugin to split the tables in to
> different databases  (16 nos).
>
> After implementing these changes all blogs were accessible fine, and we sent
> this code base to our testing team, and no major issues were reported.  We
> made sure, that all SQL queries uses $wpdb variables for the table names.
> Now the code is in production and running smooth.  The 1 lakh tables is now
> split to around 5000 - 6000 tables to 17 different DB's .
>
> Wanted to know your views on it.
>
> Regards,
> Senthil
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Beau Lebens
Dented Reality
beau at dentedreality.com.au
http://dentedreality.com.au


More information about the wp-hackers mailing list