Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



As a counter point - Try to avoid caching until all other options are exhausted. They tend to complicate matters and pave over the real problems, when they could some times have been solved more elegantly.


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


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.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: