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

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-...



I 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


There 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.


Has 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 [2] https://github.com/tiangolo/fastapi/issues/617


Yes 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#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


just 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-si...


How does it compare to Starlette? (lib FastAPI uses under the hood) I've used vanilla Starlette for recent projects and it's been great.


It was based on starlette first but all functionalities are rewritten ending up in better code quality. 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 .


Hi, 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.


Ok that makes sense! I'll check it out. I pretty much just use Starlette + Mangum + Marshmallow for basic api functionality.


Nice, thanks. I wonder how performance compares to django-ninja.


We 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.




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

Search: