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

Id go with Fast API in Python over Django.


Fast API isn't a replacement for Django. It's a replacement for like 5% of Django.


Concur. It's a Flask replacement. Ie, for adding HTTP communications to a program. Django is for websites.


True but the other 95% of stuff in Django can be replaced with other libraries out there to make the code way more modular.


Which sounds terrible. Why have one dependency with things that work well together when we could have 100 things to maintain and keep updated?

I wouldn't do this unless I absolutely had to.


1) You don't have to keep 100 things maintained. Upgrading packages is not something that you are going to do that often, and really, you shouldn't even worry about upgrades unless there is a security problem.

2) Having modular code means that things are isolated when you DO need to upgrade.


That's bad advice, given how expensive it is to upgrade later.

You aren't gonna convince people familiar with Django that your API library is a Django replacement. That's like saying Express.js replaces Spring. Well, no...


Also in my experience Django is extremely slow generally than Flask or FastAPI.

Even placing a CDN in front of Django doesn’t help in that regard.

With that being said, not many people upgrade their dependencies that much anyway for Flask / FastAPI.


> Also in my experience Django is extremely slow generally than Flask or FastAPI.

Nobody cares. Seriously. I can handle 100rps on a $5 server for most of the pages on my Django sites. Do you know how many $100m+ ARR businesses I've worked for that never hit 100rps on a regular basis? Most of them.

> for Flask / FastAPI

What about the dozen other dependencies you now need to use? and now you need to test those upgrades carefully, because python.


> Nobody cares... Seriously. I can handle 100rps on a $5 server for most of the pages on my Django sites. Do you know how many $100m+ ARR businesses I've worked for that never hit 100rps on a regular basis? Most of them.

I dunno, my clients paying my business care, speed is important in certain sectors such as mine.

I run and own a pest control SaaS on Flask that pulls in $1.7M+ ARR, when you're an upstart, speed is an advantage, I would imagine the $100m+ ARR business you worked for would be slow anyway.

> What about the dozen other dependencies you now need to use? and now you need to test those upgrades carefully, because python.

I just pin my dependencies, and since I'm making money it just runs itself really.


I should have rephrased it as "nobody picking Django cares". People pick Django because of how quickly you can build something valuable. Everyone knows it's slow IMO.

> when you're an upstart, speed is an advantage,

Yes, this is kind of the whole point of FastComments :) but still, the SLAs are like 30ms for most endpoints. I wouldn't use Django for this - but I wouldn't (didn't) choose Python either.

> I just pin my dependencies, and since I'm making money it just runs itself really.

Pinning is good. Never updating them is bad, gets a lot harder later.


I agree with this. Fast API provides a better developer experience because of how simple it is, and it's also more performant.


Why?


Python is gonna be slower than Java and other compiled languages. Thats the price you pay for fast development. While most of your speed is going to be bottlenecked by network, there is still value in getting some optimizations to being able to handle more load.

Fast API is basically async implementation of your standard API coding on top of uvicorn (which is a web server), which is built on uvloop, which is a faster event loop.




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

Search: