

Ask HN: What did you learn in building your scalable web application? - sravfeyn

I have built couple of client-side API mash-ups. I have only worked as an intern on a big (in terms of users) web application. I am planning to build a Django application on AWS for a large user base. Though I can build a quick prototype on Django, I just have no experience to learn from.<p>What are the common 'gotchas' in building a scalable application in Django on AWS? I intend to learn from industry experiences. Please tell your personal experience and give some pointers to blog posts or books.
======
saeidm
Unless you're talking about a million concurrent users or something, Django
actually scales pretty well for medium concurrency.

Here's some basic advice though (1) Cache stuff. Django has a built-in cache
framework, but sometimes I even cache stuff in the process (It's not best
practice at all, mind you, and every pro will tell you to stay away from that)

(2) Use the ORM properly! For example, never do something like
len(MyModel.objects.filter(arg='blah')) to do things like count entries or see
if entries exist. Instead use .count() or .exists()

(3) Unless it's something complicated, I would just use something like Heroku.
Easy to scale resources up and down as well as deploy. I typically use AWS S3
as my static host and Heroku as my Django host.

~~~
sravfeyn
Thanks. Can you please explain 3rd point. How is EC2 complicated than Heroku?

~~~
kevinrpope
Deployment with Heroku: Write app. 'git push heroku master'. Scaling with
Heroku: Drag the scroll bar in the admin panel.

Deployment on EC2: Write app. Provision EC2 instance. Ensure instance has all
the software you need (Framework, nginx, etc), and install it if needed. Pull
code from repository. Start all necessary processes. Scaling with EC2: Repeat
deployment steps (but this should be easier because you know what needs to be
done with the image you've selected).

Heroku is easier and removes the headaches of running your own server. If you
like running your own server - and know how to secure and optimize it - then
EC2 (or linode, rackspace, etc) is a good option.

------
the_cat_kittles
new relic (<https://newrelic.com/>) + load testing with funkload has been
helpful for me so far, but we shall see...

