Live data from Hacker News

FastAPI 0.100.0 release notes

fastapi.tiangolo.com

11–20 of 115 posts

Re: FastAPI 0.100.0 release notes

#11

> FastAPI is already being used in production in many applications and systems. And the test coverage is kept at 100%. But its development is still moving quickly. New features are added frequently, bugs are fixed regularly, and the code is still continuously improving. That's why the current versions are still 0.x.x, this reflects that each version could potentially have breaking changes.[1] What kind of weird reaso…

This is semver:

> Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

(from https://semver.org/)

Re: FastAPI 0.100.0 release notes

#12

> In some cases, for pure data validation and processing, you can get performance improvements of 20x or more. This means 2,000% or more. Amazing! Excited to try it out. Slightly OT: But what are some use-cases where you'd still use Flask over FastAPI? I really like FastAPI's devEx and don't see myself going back to Flask anytime soon. Curious to hear what others think.

Flask has been around much longer than FastAPI and, as a result, is a much more mature framework. Some examples:

- There's a memory leak with a particular combination of packages FastAPI [0]

- Before Pydantic v2, you would validate your data on input (when it's stored in the db) and then every single time on retrieval. There is no way to skip validation, for example, when you are generating a response on data that was already validated when it was persisted to the db. [1]

- FastAPI has documentation only in the form of tutorials. There is no API documentation and if something is not clear looking through the source code is the only option

- You need ORJSON for maximum serialisation performance (perhaps this has changed with Pydantic v2) [2]

- Using FastAPI with uvicorn doesn't respect log format settings [3]

I don't mean to imply that FastAPI is a bad framework. The Flask ecosystem has had over a decade to mature. FastAPI and the ecosystem will get there but it _needs_ time.

- [0] https://github.com/tiangolo/fastapi/discussions/9082

- [1] https://github.com/pydantic/pydantic/issues/1212

- [2] https://fastapi.tiangolo.com/advanced/custom-response/#use-o...

- [3] https://github.com/encode/uvicorn/issues/527

Re: FastAPI 0.100.0 release notes

#14
post #13

I'm really curious about why you would want to use FastAPI over Django Rest Framework. Are there signficant advantages to FastAPI?

I've just made a first project in fastAPI, and it was trivially simple compared to my previous adventures in DRF. Plus asyc from the get go, which was also pleasant. I had a task as part of this that takes 10 seconds to run, and there's a built in way to allow it to run in the background.

And the documentation is excellent.

Re: FastAPI 0.100.0 release notes

#15

> In some cases, for pure data validation and processing, you can get performance improvements of 20x or more. This means 2,000% or more. Amazing! Excited to try it out. Slightly OT: But what are some use-cases where you'd still use Flask over FastAPI? I really like FastAPI's devEx and don't see myself going back to Flask anytime soon. Curious to hear what others think.

Not to be excessively negative, but this really means very little without more context. Maybe it was very slow before, or it's a particulary unused scenario. I'm always skeptical when people write such praises of their own software without giving a comparison point.

Pydantic was a pure python library and was rewritten in Rust recently. To be fair, I have seen some critiques of this rewrite. Specifically saying that the validation model could have been much faster in Python and switching languages papers over the deficiencies. I'm not in a good place to judge if this is true or not.

Re: FastAPI 0.100.0 release notes

#16
post #11

> FastAPI is already being used in production in many applications and systems. And the test coverage is kept at 100%. But its development is still moving quickly. New features are added frequently, bugs are fixed regularly, and the code is still continuously improving. That's why the current versions are still 0.x.x, this reflects that each version could potentially have breaking changes.[1] What kind of weird reaso…

This is semver: > Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable. (from https://semver.org/ )

Sure, depending on how you interpret initial development. FastAPI has 60k stars on GitHub, has been extremely popular for at least four years, and is widely used in production by a lot of people. It's the maintainers' decision what their goals are for a v1 release, but I was personally surprised to learn that it hasn't had one yet. I can see why one might argue that they're not following the spirit of semver at this point.

Re: FastAPI 0.100.0 release notes

#17

> FastAPI is already being used in production in many applications and systems. And the test coverage is kept at 100%. But its development is still moving quickly. New features are added frequently, bugs are fixed regularly, and the code is still continuously improving. That's why the current versions are still 0.x.x, this reflects that each version could potentially have breaking changes.[1] What kind of weird reaso…

[deleted]

Re: FastAPI 0.100.0 release notes

#18
post #12

> In some cases, for pure data validation and processing, you can get performance improvements of 20x or more. This means 2,000% or more. Amazing! Excited to try it out. Slightly OT: But what are some use-cases where you'd still use Flask over FastAPI? I really like FastAPI's devEx and don't see myself going back to Flask anytime soon. Curious to hear what others think.

Flask has been around much longer than FastAPI and, as a result, is a much more mature framework. Some examples: - There's a memory leak with a particular combination of packages FastAPI [0] - Before Pydantic v2, you would validate your data on input (when it's stored in the db) and then every single time on retrieval. There is no way to skip validation, for example, when you are generating a response on data that wa…

> - You need ORJSON for maximum serialisation performance (perhaps this has changed with Pydantic v2) [2]

The common orjson trick no longer works in v2 and will throw warnings, but it appears it's no longer necessary since the JSON formatting leverages the native seralizer which happens in Rust-land.

Re: FastAPI 0.100.0 release notes

#20

> FastAPI is already being used in production in many applications and systems. And the test coverage is kept at 100%. But its development is still moving quickly. New features are added frequently, bugs are fixed regularly, and the code is still continuously improving. That's why the current versions are still 0.x.x, this reflects that each version could potentially have breaking changes.[1] What kind of weird reaso…

FWIW other frameworks (namely, flask) took a similar approach of not moving to 1.0 for a while.
Post reply on HN