database – I want to replicate a wordpress website over multiple servers
Yes, you can have 2, tens, even hundreds of individual servers running WordPress with the same codebase connected to the same database server. But there are lots of non-WordPress steps you need to take to get it working, and it may not solve your problem.
- You would need to figure out a load balancing solution, which would not involve WordPress
- This does nothing if the performance bottleneck is the database, that would require database replication which is a separate topic
- A robust page caching solution, or software such as varnish would be more performant for a much lower cost
Just adding more servers is not a silver bullet solution, and can lead to odd issues ( e.g. cron job race conditions, that usually crop up when syndicating or pulling in posts only to find there are duplicate posts created ). This is assuming it helps at all, you should measure your performance and scaling bottlenecks and identify where the cost is and what the bottlenecks are on the server side.
Keep in mind that you can serve tens of thousands of page views on the cheapest Digital Ocean droplet ( ~$5pm ) if it’s set up right, persistent object caching, full-page caches for logged out requests, and a well built site that doesn’t lean heavily on post meta searches and NOT IN queries.