Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Updated the title to reflect what the question is actually asking
Link

Is there any way to use multiple Wordpress Database without having Can I split a custom database queryhuge wp_postmeta table across different databases or servers?

Source Link

Is there any way to use multiple Wordpress Database without having a custom database query

This question doesn't have any codes, it's more of a theoretical question. I need guidance on what method to look for. I've searched on google before but found nothing on this specific case.

I have 2 servers(CentOS) where I have MySQL database set up. In one server(server 1) I have Wordpress installation(LAMP) with the database set up. The site is working. However, I want to split the database that is currently on server 1 and host it partially on server 2. Now, I know how to use a remote database in WordPress' wp-config.php file but here I want to use two databases.

In this case, I can try a manual query from the second server. However the reason I want to split the databases because of a single table that includes more than a million entries. Because the table is also going to be split, and the table is wordpress' default post meta table, and I wouldn't know which posts are going to be in which database(more than million entries!), I can't use a custom query. Also I know that default $wbdp only pulls data from 1 database.

To summarize this question, is there any way to use multiple Wordpress Database without having a custom database query?