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

Django is not meant to be run at scale. At least not horizontal scale. If you're not going to use the ORM, which prevents you from scaling horizontally, why are you using Django? Django can be scaled by getting large instances with lots of RAM, which is quite affordable these days. It can also be scaled with caching. But if you want horizontal scaling, don't use Django. That's not what it's for.


There's nothing really inherent to Django that prevents it from scaling horizontally, not even the ORM. For the typical SQL read-heavy workload it will scale as well as anything else depending on the scalability of the backing RDBMS. Should always use proper HTTP response caching with something like Varnish or via 3rd-party CDN where possible.


> depending on the scalability of the backing RDBMS

As far as I know, none of the backing RDBMSs that the ORM supports are horizontally distributable. At least not officially, right? CockroachDB with its Postgres interface sounds good, or Citus? But as of today, are any of the supported DBs distributed?


MySQL Cluster [1] has been around a long time for applications that need linear scalability with ACID guarantees

[1] https://www.mysql.com/products/cluster/


How does the ORM prevent horizontal scaling?


The ORM works against a relational database. The relational databases that Django supports are not distributed, right?


May depend on your workload and what you mean by 'distributed'... there are some scalablleity options for postrgres. There are backend drivers for Oracle and MS SQL as well, but I have never used either and I'm not sure just how good they are.

But there is nothing that I am aware of inherent to the ORM itself that prevent horizontal scale.


You scale your app server out and your database server up. You can have 100 django servers hitting one database with a read-replica, for example.

Depending on your workload, this is often a great way to scale and pretty typical for Django. In most cases your app servers will saturate way before the database does.


Thanks for this. Yes this actually makes sense. I considered that a given, though, since scaling the Django app is trivial since it is stateless. Scaling the state is always the difficult thing.


You can get horizontally scaled eventually consistent on reads just fine on postgres/mysql via replication. There are also write scaling options.




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

Search: