3 ms·
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
by linkmotif 9y ago
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.
- benwilber0 9y agoThere'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.
- linkmotif 9y ago> 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?
- benwilber0 9y agoMySQL Cluster [1] has been around a long time for applications that need linear scalability with ACID guarantees [1] https://www.mysql.com/products/cluster/ https://www.mysql.com/products/cluster/
- ensignavenger 9y agoHow does the ORM prevent horizontal scaling?
- linkmotif 9y agoThe ORM works against a relational database. The relational databases that Django supports are not distributed, right?
- bpicolo 9y agoYou can get horizontally scaled eventually consistent on reads just fine on postgres/mysql via replication. There are also write scaling options.
- squeaky-clean 9y agoYou 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.
- linkmotif 9y agoThanks 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.
- ensignavenger 9y agoMay 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.