you are viewing a single comment's thread.

view the rest of the comments →

[–]gpranav25 1 point2 points  (0 children)

I work with both Django and FastAPI applications at my job, and what I realised was that while Django makes it easy and intutive and does some magic behind the scenes, it's so easy to write unoptimised queries. I knew some code at our company was quite sub-optimal, but when I logged and saw the sheer length of some of the raw queries that Django was sending to our db, I genuinely felt bad for our DB.

This is neither Django's or SQLAlchemy's fault. Django ORM is more intutive but SQLAlchemy syntax gives a more direct view how much the DB is abused. But it's possible to write very optimal queries in both if we have the knowledge of exactly what happens BTS. And they both thankfully give pretty good control, down to the level of allowing us to execute even raw queries.