Using WordPress with a database in the cloud

Looking for a way to speed up a WordPress website with a very large database? One solution might be to use an external database in the cloud.

The first thing that came to my mind was to look at Amazon AWS for their solution. I found that it’s called Amazon RDS and you can use it as a replacement for your local database. Of course there are also other similar solutions offered by Google and Microsoft Azure.

Setting it up

The setup is fairly easy, I used the steps described here and although the AWS interface has changed, the process is pretty similar. You have to login to the AWS dashboard and choose RDS from the Services dropdown. On that page click on the “Launch a DB instance” button.

A sidenote: The interesting part is on the next page, you can choose from multiple types of databases and what caught my eye was the Amazon Aurora option which is MySQL compatible! (which means you can just import an SQL dump ). Digging more into it I found that WordPress linked to an Amazon Aurora DB has proven to give great results.

If you choose either Aurora or MySQL you will have similar steps to set up and you can choose the processing power and set a master username and password to connect to the db server.

After the setup it will take a few minutes for the server to come online. Afterwards you can connect to it directly and import your database ( if you have an existing website ) – on OS X I recommend using Sequel Pro. For the server use the “endpoint” from the dashboard and the username and password you set in the setup.

Next you just change the database details in the wp-config.php file to the ones you find in the Amazon RDS dashboard. If everything went well you should have an WordPress website running on a cloud database, cool!

Some notes

Be careful which pack you choose as an Aurora server tends to get expensive quickly. From my estimates, the cheapest goes to around 200$ per month.

For the regular MySQL db you can go for as low as 12$ per month from what I have read.

Also make sure that you choose an AWS region that is close to your website’s host server. This will greatly influence the loading times and might cause more problems than improvements.