Django Database Scalability

We have a new django powered project that has the potential for heavy traffic (meaning interacting with heavy db). Therefore, we need to study the scalability of the database in advance. With some studies, the following questions are still unclear to us:

  • coarse-grained: how to specify one db table (django model) for a specific db (possibly on another server)?
  • fine-grained: how to point a group of table rows to a specific db (the so-called sharding, can also be on another db server)?
  • how to specify write and read for different db? (which will be useful for future master / slave mysql replication)

We find a solution with:

  • be transparent to the application program (which means we do not need to have additional codes in views.py)
  • must be at the ORM level (you only need to specify in models.py)
  • compatible with the current (or future) version of django (to keep a minimal change for future django upgrades)

I'm still doing research. And share this question later if I have some fruit.

Hope someone with experience can answer. Thanks.

+3
source share
3 answers

Do not forget about caching. Using memcached to reduce the load on the database is key to building a high performance site.

As alex said, django-core does not support your specific requests for these functions, although they are definitely on the task list.

, . , SQL-. , , , ORM .

+2
+1

here for some reason we are using django with sqlalchemy. maybe a combination of django and sqlalchemy also works for your needs.

0
source

Source: https://habr.com/ru/post/1720433/


All Articles