I think it might be useful to show a few small examples of what a small setup would look like, and what it might cost.

A basic setup would consist of an Elastic Load Balancer,  two EC2 instances for the front end webservers, and a connection to amazon RDS for the backend database.  In this case we’ll run Memcached on both EC2 instances, to save some money compared to using elasticache since we’re not memory taxed on these instances.  We will use S3 for backups of the web servers.  If we had different needs we could incorporate EBS snapshots.  Finally, we’ll make sure we have our security groups configured properly to lock down access as much as possible.


Basic AWS configuration

ELB, 2 EC2 Instances, RDS, S3, EBS snapshots

Using whatever DNS you have, you create a CNAME to point to the ELB, which we configure to distribute traffic across both web front ends.  We have them connect directly to RDS for database uses, bouncing through memcached of course to keep some load off of the DB.  Using chef, it’s trivial to ensure memcached is up and running on the private IP’s only, and using security groups, we can ensure that ONLY the machines in the WEB_FE security group have access to port 11211 on the private IP’s.  This way your application can list both memcached servers, and distribute the load.

Since chef is configuring the machines for us, it’s easy to have it add cronjobs to use something such as s3sync to sync whatever data we want to s3 for backup directly from the EC2 instances.  By default I like to do daily, weekly, and monthly backups.  This can easily be tweaked depending on how many backups you want, and how much money you want to spend!  If you want a complete hard drive image, we can script EBS snapshots, to happen on whatever timeframe you would prefer.

Once everything is up and running, have a nice, basic environment up and running!

We can expand on this, and spin up dev environments that are IDENTICAL to the production environment quickly and easily, since the configuration is all stored in chef.  Chef supports multiple environments and handles them gracefully.

Leave a Reply

Your email address will not be published. Required fields are marked *