WordPress on Amazon RDS

Every WordPress blog must have a database to store all its data (posts, comments, settings and so on). WordPress uses the MySQL database. Usually the database is stored locally ob the web server of the blog. In some cases one would want to have the database installed elsewhere for many reasons (loads, capacity, backups). This is where Amazon RDS kicks in.

What is Amazon RDS?

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. That means that you can have your MySQL database operate on Amazon’s cloud computers located all over the world. Just like they say:

Amazon RDS gives you access to the full capabilities of a familiar MySQL database. This means the code, applications, and tools you already use today with your existing MySQL databases work seamlessly with Amazon RDS. Amazon RDS automatically patches the database software and backs up your database, storing the backups for a user-defined retention period. You also benefit from the flexibility of being able to scale the compute resources or storage capacity associated with your relational database instance via a single API call.

According to Amazon there is no need to make any changes to your application in order to use Amazon RDS. Well, at least for WordPress and WordPress-MU they are right.

A standard WordPress installation, using Amazon RDS, is located at WordPressRDS.com and a WordPress-MU (the kind of WordPress that wordpress.com uses) is located at mu.WordPressRDS.com. I will keep this installation alive for a few days and then take it down since the use of Amazon RDS is not free.

If you would like to help me finance this demo please consider a donation via PayPal.

Amazon RDS is charged by the hour + storage + I/O requests and in and out data transfer (see full pricing). The smallest database instance you can get is with 1.7GB RAM with the cost of 0.11$ per hour. If you run a full month it sums up to about 82$/month. The next level is a huge jump to a large instance of 7.5GB RAM with the cost of 0.44$ per hour (~330$/month). However, for those who are seeking a multi-db solution for WordPress MU may consider testing two or three small instances.

So lets get started!

The first thing you will have to do is setup an Amazon RDS instance. If you don’t have an account with Amazon you should creat an AWS account. Once you have an account you may signup for Amazon RDS.

To set up the RDS instance read some of the resources available. If you use WordPress you probably would start with the PHP sample code. I may give specific code samples at a later time but you will have to use the following APIs (in this order):

  1. CreateDBSecurityGroup – setup a database security group.
  2. AuthorizeDBSecurityGroupIngress – authorize access from your servers IP for the above group.
  3. CreateDBInstance – set up the instance and first database (including root user, password and database name).

If all goes well you may check the instance using the DescribeDBInstances API call and look for the ‘Status‘ field making sure it is in ‘Available‘ state. In the results of this call you will also see the unique host name of the database. Amazon calls it ‘endpoint address‘. If you got it your are done!

Now setup WordPress (or WordPress Mu)

The final step is to run a regular setup of WordPress (or WordPress MU). You are probably familiar with the setup screen (click on the image to enlarge):


See the ‘DataBase Host‘ field? That is where the ‘endpoint address‘ goes. I guess this is one of those other 1% cases. Now just continue the installation as usual.

A WordPress MU installation is just the same:


I have installed WordPress and WordPress-MU on Amazon RDS at WordPressRDS.com. Check it out and please consider a donation via PayPal to keep these installation running.


Did you find this post interesting? Please subscribe to my feed.

Comments 9

  1. Brent Shepherd wrote:

    Elad, you are a legend!

    I received Amazon’s email about the RDS beta the other day and have been hoping to try it out with WP & WPMU. But as you’ve done the leg work and shared the details, it will make my job much easier. Thanks! 🙂

    Posted 31 Oct 2009 at 2:44 pm
  2. eyecool wrote:

    That’s great! Are you using Amazon to host the entire MU deployment, files and all? Or just the DB?

    Posted 16 Jan 2010 at 1:15 am
  3. mark k. wrote:

    I don’t understand why rds should be attractive enough for anyone. with 80+$ per month you can get a decent VPS, and you will not have to worry about caching and optimizing your DB request. I think that with slicehost (my hosting provider) you get a 1GB RAM VPS for 70$.

    The only advantage I can see is that you don’t need to split the DB across several machines for large mu site. But for how many people this is going to be important enough?

    Posted 20 Jan 2010 at 7:14 pm
  4. Elad wrote:

    eyecool, just the db.

    Posted 08 Feb 2010 at 9:38 am
  5. Frederic Sidler wrote:

    Elad, thank you for sharing. I just do not see where the scalability comes into place in such a configuration.

    Posted 14 Sep 2010 at 11:41 am
  6. Elad wrote:

    Well, for example you might be able split your database over a few RDS instances.

    Posted 15 Sep 2010 at 2:16 am
  7. John wrote:

    This is just what I am looking for. I am currently on a VPS that I am looking to scale more in the future and I am considering Amazon services for it.

    Is WordPressRDS.com on Amazons AWS and RDS? Or just RDS?


    Posted 22 Oct 2010 at 8:35 pm
  8. Elad wrote:

    It was only on RDS (not EC). I took it off just to save a few $$$.

    Posted 22 Oct 2010 at 10:03 pm
  9. David Bullock wrote:

    I’m working currently on a fairly large WordPress install using Amazon RDS and EC2 for one of my clients. One of the issues I ran into fairly early on when first working with RDS is that the installation specific global settings aren’t adjustable through the standard SQL interface, and many of them aren’t preconfigured in useful manner.

    A big one for us of course was the Query Cache. Another one to look out for is the timezone.

    Instead you need to create a parameter group, which you can do through the Amazon Web Console. Once you have the parameter group, you can use the Amazon RDS command line tools to modify your parameters and choose when those parameters are applied (i.e. immediately, after-reboot, etc.)

    Setting up the RDS CLI tools is a bit clunky and it’s odd that as simple as the operations are, that you can’t execute them through the web interface.

    Also keep in mind that an advantage of EC2 over most VPS is rapid deployment to support scaling. I can bring up an additional copy to share load in another 5 minutes and add it to the load balancer immediately.

    Similarly I can setup multiple RDS instances both for redundany, and for use with something like HyperDB to support additional scaling.

    – Dave

    Posted 09 Jul 2011 at 8:43 pm

Trackbacks & Pingbacks 4

  1. From Drupal ja EC2 » Cloud Computing on 04 Nov 2009 at 4:06 pm

    […] tarjoamalla väittämänsä mukaan täysverisen relaatiotietokannan pilvessä. Ilmeisen helposti esim. WordPress alustalle istui. Aiheesta Yleistä « Ubuntu 9.10 ja Amazon […]

  2. From Woah… awesome! « AWS RDS and WP MU = Awesome! on 08 Nov 2009 at 6:40 pm

    […] is great, Elad! It’s […]

  3. From untell.com on 06 Dec 2009 at 9:28 am

    WordPress on Amazon RDS | Ring Of Blogs…

    Every WordPress blog must have a database to store all its data (posts, comments, settings and so on). WordPress uses the MySQL database. Usually the database…

  4. From S3 Explorer review | Ring Of Blogs on 16 Feb 2010 at 9:03 am

    […] S3 Explorer review Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.Powered by WP Greet Box WordPress PluginI have been using Amazon web services for some time now. I have started with Amazon Simple Storage (S3) for off-loading WPMU theme files and later on started using it for daily backup of all my web sites and blogs. The backup is actually a small script that zips all my files and send them to Amazon S3 storage using the great Amazon S3 PHP class by Donovan Schonknecht. More recently I have tested Amazon Relational Database Service and managed to install WordPress and WordPress MU on it. […]

Post a Comment

Your email is never published nor shared. Required fields are marked *