4 ms·
https://litestar.dev https://litestar.dev is also reaching 2.0 .it is a lot faster than FastAPI yet much better maintained. Has DTO, event and channels, Reposit
by v3ss0n 3y ago
https://litestar.dev https://litestar.dev is also reaching 2.0 .it is a lot faster than FastAPI yet much better maintained. Has DTO, event and channels, Repository, Service DDD style framework built-in. No promotional commits.
I had written the reason of moving away from FastApi here and intro to Litestar 2.0.
https://dev.to/v3ss0n/litestar-20-beta-speed-of-light-power-of-stars-1j62 https://dev.to/v3ss0n/litestar-20-beta-speed-of-light-power-...
- winrid 3y agoNice, thanks. I wonder how performance compares to django-ninja.
- v3ss0n 3y agoWe haven't test Django ninja in term of performance. But from our experience of Django 4.2 async , Django isn't truly asynchronous yet. Since ecosystem is not asynchronous I am not sure how asynchronous API would benefit from that when the extension aren't.
- lyu07282 3y agoI think you raised some valid concerns there, I see 18 open issues in the fastapi repo, what's going on there? Are they just moving everything into a discussion? A bit concerning
- v3ss0n 3y agoThere are thousands of issues which about 30% of them are actual bugs, including some of them are those we found on production and reported, the maintainer wrote a script that convert all to discussion and never looked back, so we never look back too.
- holler 3y agoHow does it compare to Starlette? (lib FastAPI uses under the hood) I've used vanilla Starlette for recent projects and it's been great.
- v3ss0n 3y agoIt was based on starlette first but all functionalities are rewritten ending up in better code quality. https://github.com/orgs/litestar-org/discussions/612 https://github.com/orgs/litestar-org/discussions/612 Starlette can be considered pure server framework in the lines of CherryPy, wezurg in wsgi/sync world. Litestar is a lot more battery included with built-in integration to Sqalchemy, many other ORMs as plugin. Built-in security and authentication middleware. Join our discord, we have good community there too .
- provinzkraut 3y agoHi, Litestar maintainer here. Starlette and Litestar are very different. Starlette is closer to Flask or actually Werkzeug; A micro framework / toolkit for building apps. While we don’t aim to develop "The next Django", Litestar offers way more out of the box than Starlette and other micro frameworks.
- holler 3y agoOk that makes sense! I'll check it out. I pretty much just use Starlette + Mangum + Marshmallow for basic api functionality.
- delijati 3y agoHas litestar CBV (class based views) fastapi refuses to implement them so we build [1]. Or proper lifetime event [2]? [1] https://github.com/KiraPC/fastapi-router-controller https://github.com/KiraPC/fastapi-router-controller [2] https://github.com/tiangolo/fastapi/issues/617 https://github.com/tiangolo/fastapi/issues/617
- delijati 3y agojust looked into the docs [1] and indeed it has CBV ... I will definitely take a closer look. [1] https://docs.litestar.dev/latest/#feature-comparison-with-similar-frameworks https://docs.litestar.dev/latest/#feature-comparison-with-si...
- v3ss0n 3y agoYes litestar have class based controllers since day one , class based views with HTMX/Jinja is also available in 2.0 which is now nearing release. Here is lifecycle management : https://docs.litestar.dev/2/usage/the-litestar-app.html#startup-and-shutdown https://docs.litestar.dev/2/usage/the-litestar-app.html#star... app = Litestar(on_startup=[get_db_connection], on_shutdown=[close_db_connection]) We have quite powerful channels and event systems that goes along with websocket and realtime systems too. Plus , if you use Repository + Sqlalchmey Plugin and DTO , you can also work with CRUD events before_update/after_update/before_insert/after_instet etc