[Answered ]-Advice on Amazon Web Services Setup for Django Back end & iOS Front end

1👍

The answer largely depends on your tolerance for downtime vs your monthly budget for AWS. A few points:

  • Never run anything important on a single instance. For your app tier, you should be using a minimum of two instances, each in separate AZ, with load distributed by an Elastic Load Balancer.

  • For Postgres, set up two instances (also in separate AZ’s) and configure replication. I’d also highly recommend that you use provisioned IOPS EBS volumes and provisioned IOPS-optimized instances.

  • Definately look into Elastic Beanstalk. This will greatly simplify setting an autoscaling app tier and make it a snap to deploy code to it. This will also make it easy to set up separate staging and production environments so you can Q&A your code before rolling it to users.

  • Consider setting a VPC for increased security and more control over your network resources. There’s a bit of an initial learning curve, but it’s worth it, especially when you plan to set up DB replication.

  • Set up SNS alerts via CloudWatch alarms so you get notified when things break.

  • Scale out before you scale up. Meaning, use a greater number of smaller instances before you move up to larger instances. This minimizes the impact of a single instance failure in your autoscaling group. It also allows more granular autoscaling. Don’t use large instances until you’ve benchmarked your application and discovered that you need them.

  • Once you know what size instances you actually need, purchase reserved instances to save yourself at least 40% over 12 months.

I go into more detail about some of these items (and provide a few other tips) on my blog.

👤jamieb

1👍

I’m a developer that has recently started deploying my django sites up on AWS – i’m not great at servers, but i have a setup process that I use for getting micro instances for development up and going quickly. These are some of the steps I take to set up a server: http://yaconiello.com/blog/setting-aws-ec2-instance-nginx-django-uwsgi-and-mysql/. I only link on the off chance that there is something you aren’t already doing on your AWS large instances.

A big difference between your and my app is that you use postgres as a DB. I wrote one app that used PG and the biggest performance boost I ever made was installing/configuring pgbouncer. PGbouncer does connection pooling like boss.

Also, as much as I love aws, I stopped using S3 in favor of rackspace’s cloudfiles + the django-cumulus package. I didn’t like some of the boto/storages support for S3.

0👍

I used the Google App Engine for some of my projects and hated it. AWS I hear is better than the App Engine, but still expensive. So your going to pay a lot more to get your project off the ground with the cloud as opposed to some sort of shared hosting or dedicated server hosting with Webfaction or the like. I would recommend Webfaction for young web applications, than if the traffic is justified move to the cloud (although I still wouldn’t).

The Google App Engine cloud has confusing price models that Google does not even understand and they don’t have nearly the freedom of using somebody like Webfaction or any other hosting plan for that matter.

0👍

Using something like fabric might help if you have absolutely no clue setting up instances and stuff.

https://github.com/fabric/fabric/tree/1.6

Leave a comment