17 ms·
FastAPI framework, high perf, easy to learn, fast to code, ready for production
- EamonnMR 6y agoI've used FastAPI for a while now. It's very nice. Make sure you combine it with Pydantic and type hint liberally.
- iooi 6y agoI would love to know what HN's python folks are using for new projects these days. I've looked at FastAPI before and it has some nice features like asyncio and pydantic integrations. But it doesn't have any official users library, and ideally a framework should have that available. I've started looking outside of the Python ecosystem since it feels like there's nothing new and exciting come out of there. I've played around a bit with NestJS and it's amazing how far the TypeScript ecosystem has come. It's also crazy that SQLAlchemy doesn't have typing support still, so TypeORM looks really appealing.
- gmfawcett 6y agoI disagree that FastAPI should have an official users library. A popular third-party one would be fine, but it doesn't belong in the core project.
- iooi 6y agoI can see that, I think what I meant was "de facto" (think flask-user) library instead of "official".
- eddsalkield 6y agoI'd recommend you check out FastAPI-Users if you haven't already: https://github.com/frankie567/fastapi-users https://github.com/frankie567/fastapi-users It provides a users framework with OAuth2 integration, support for different ORM backends, and routes for authentication, verification, etc. Full disclosure: I am a contributor to this project.
- alchermd 6y agoI still use Django to this day, both for monolithic SSRs and REST APIs. All the batteries it comes with are perfect for the common use case, and the small "bubble" around it (ex: DRF) is as good as it gets IMO. The tooling around REST APIs are lacking compared to Flask and FastAPI, but wrangling what's available (drf-yasg, oauth2lib) to suit my needs is better than migrating to another framework I think.
- konschubert 6y agoSame here. When I want to get a new project of the ground, I use Django. This partially due to the batteries included, partially because I am very familiar with it. On more mature projects, at the stage where I really start splitting services into their own hosts, I switch to something else. Django's batteries are no longer useful at this stage, since e.g. auth is it's own service now.
- boxed 6y agoDjango plus django-fastdev plus iommi. Full disclosure: I'm the author of django-fastdev and co-author of iommi.
- __mp 6y agoWe're using FastAPI for the backend. We then use the OpenAPI.json exposed by the documentation endpoint to generate API bindings for Typescript.
- tiangolo 6y agoI also looked at NestJS before creating FastAPI, and it certainly inspired ideas in FastAPI (also TypeScript in general), you can read more about that here: https://fastapi.tiangolo.com/alternatives/ https://fastapi.tiangolo.com/alternatives/ About ORM with types, yeah, I also want an ORM based on standard type annotations. So I started playing with mixing SQLAlchemy and Pydantic, and I have some unfinished lab experiment with it. I haven't found the time to finish it, but hopefully I'll find it soon.
- nickjj 6y agoI still happily use Flask with mostly Jinja rendered templates. With things like Hotwire and htmx you can build very nice feeling apps without going all-in with an API back-end and JS front-end. I released https://github.com/nickjj/docker-flask-example https://github.com/nickjj/docker-flask-example as a starter kit for what I use in new projects. It wires up things like SQLAlchemy, Celery, Flask, gunicorn, Webpack, etc. with Docker. It also comes with CLI extensions for digesting / md5 tagging assets with optional CDN support using Flask-Static-Digest, database migrations / seeding with Flask-DB and more. If I ever need to create API endpoints I combine Flask-Classful (routing), Marshmallow (serialization / validation) and Flask-JWT-Extended (authentication). I've written about this combo at: https://nickjanetakis.com/blog/flask-libraries-for-building-awesome-real-world-restful-apis https://nickjanetakis.com/blog/flask-libraries-for-building-...
- anthony_barker 6y agoJust finished 2 projects with this ... Typer is amazing - cli and api at once! type checks! very nice.. We used PeeWee as the ORM
- disgrunt 6y agoHow are you doing async with peewee?
- jamil7 6y agoI'm not really a backend developer but needed to put together a pretty simple backend recently for a client project (mobile app). FastAPI is really productive in all the areas you'd normally reach for Flask. I used SQLAlachemy as an ORM with Postgres and PostGIS. I had to write a bit of custom serialization stuff with Shapely to fit PostGIS in but otherwise everything was pretty much taken care of with Pydantic. It's a good level of magic/abstraction in that you can rip pieces out easily and replace them if you need to, but if you just follow the beaten path everything works. OpenAPI spec and docs is also really nice to have built-in.
- peterthehacker 6y agoI’ve used FastAPI at multiple companies now and really enjoy working with it. The tight integration with pydantic is wonderful. Also, it really is quite fast out of the box. Great for building ML prediction APIs.
- mesaframe 6y agoI like how tightly integrated types are into FastApi.
- densekernel 6y agoWe are using FastAPI in production. Some useful links: - Cookiecutter: https://github.com/tiangolo/full-stack-fastapi-postgresql https://github.com/tiangolo/full-stack-fastapi-postgresql - Cache: https://github.com/comeuplater/fastapi_cache https://github.com/comeuplater/fastapi_cache
- t_minus_3 6y agoJust checked in to say, we use fastapi in production.
- eddsalkield 6y agoI've been using FastAPI for a while, and think that the API-driven approach that it endorses is a good paradigm for building web applications. Since the design of FastAPI programs is often modular, with libraries and modules extending the API with additional routes, it seems to make sense to build front-end components according to the same module structure. I'm yet to see any of these for popular libraries, but I'd be up for helping build some in libraries like Vue. Does anyone know of existing projects/server frameworks where backend modules are coupled with front-end components that consume their API?
- tiangolo 6y agoI'm glad you're liking FastAPI! You could check the official project generator, it includes a simple Vue.js front end: https://github.com/tiangolo/full-stack-fastapi-postgresql https://github.com/tiangolo/full-stack-fastapi-postgresql Although I'm currently using React with TypeScript and hooks, and it's a great development experience. I plan on adding it to the project generator later.
- eddsalkield 6y agoThanks, that's a really helpful example. Where I think this could be taken to the next level of reusability is in modularising the front-end into API-specific components. For example, the login behaviour could depend on FastAPI-Users, with a sibling frontend library containing components that implement the same login flow. Adding user behaviour is then a matter of using the same third-party library on the front and back end. This approach could be extended to other components such as an admin panel (perhaps using https://github.com/awtkns/fastapi-crudrouter https://github.com/awtkns/fastapi-crudrouter), or a blogging component.
- tiangolo 6y agoActually I also have plans to work on a generic admin UI based on OpenAPI, so it would be independent of any DB or ORM, just based on the defined Pydantic models. But that's also gonna be for whenever I get the time to invest in it :)
- lukin0110 6y agoWe're using FastAPI in production at InvestSuite. Highly productive framework, very well written documentation. You get jump started right away. Only caveat with async python. Might be tricky when using 'sync' libraries. It's not always straightforward and you'll find yourself wondering why your server is blocked from time to time. It's not a problem of FastAPI, but you need to be aware that if you do a blocking call (function is not prefixed with 'async') to a db that it blocks the event loop.
- tiangolo 6y agoI'm glad FastAPI is useful! And thanks to InvestSuite for being one of the FastAPI gold sponsors. If you are having problems, you can ask in GitHub issues. But for the async stuff, a simple rule of thumb is to always use normal def functions and blocking (non async) libraries, that way FastAPI will do the right thing and make sure to run it in a threadpool (thanks to Starlette, the underlying library). And for the specific path operations (endpoints) where you need to optimize performance, then you can use async and carefully choose async libraries, or run the blocking code with run_in_threadpool, but you can leave those details and possible extra complexity for the cases that actually need the extra performance or async support.
- ericdevries 6y agoWe use fastapi in production too, but the problem we faced with sync stuff in combination with sqlalchemy was that the sessions (which we inject using Depends) were created before all the actual sync functions were executed, so the connection pool ran dry and everything became unresponsive. With flask I had a better experience because it creates the session in the same thread as the function that will handle the request. If you overload it a bit (say, 100 concurrent requests with a connection pool of 30) all the Depends calls will block because there are no threads left in the pool to actually handle the requests. I understand that fastapi is more suited for async stuff for which it truly works great, but it would be nice if there was a idiomatic solution within fastapi and/or starlette that prevents these kind of problems. Great work otherwise!
- 6y ago
- jamra 6y agoI built a real time trivia game in FastAPI. I liked everything about using it except for the websockets. It leans on other libraries and I has to figure out my own redis integration. In the end it was only about a day of delay so no biggie. The library is great, but I can’t speak as to its scalability as the other party didn’t want to pay.
- nwsm 6y agoI migrated a side project from Flask to FastAPI recently. It's deployed to GCP Cloud Run with a Cloud SQL database, and integrated with Auth0 and Stripe. I use tiangolo's uvicorn-gunicorn-fastapi base image. It's been really nice for me. As easy as flask, plenty of docs for real world applications, and the performance is great. The emphasis on type systems in the docs was ideal for me. I was deciding between this and DRF after wanting something more opinionated than just Flask, and I'm really happy with my decision so far.
- spinningslate 6y agoSimilarly nothing but praise and admiration for FastAPI, having also migrated over a couple of Flask projects. A couple of additional plus points to above: 1. Integration with jinja2 , meaning I was able to use all my view templates virtually untouched. 2. uvicorn supported out the box, meaning there's a production-grade web server ready to go. It'll need some work for very high volumes I'd imagine - but for low-medium load (c.10s-100s req/sec) it's working just fine for me. Flask is clear that the built-in server is not for prod use. It's not a show-stopper in the great scheme of things. But it's just one less thing to worry about with FastAPI. Building a docker image is trivially easy, so lots of hosting options.
- mvolfik 6y agoregarding the uvicorn-gunicorn-fastapi image - is it really a good idea? you'll likely gain some other dependencies as the project grows, and having some dependencies in external docker image (the tiangolo's one pip installs fastapi + stuff), and some installed by your own means sounds like a lot of trouble headache quite soon... that's why I personally went with just python image, and installing everything from pipenv
- nwsm 6y agoI'll definitely ditch it when I start having issues!
- karmakaze 6y agoSometimes I read comments fist so some context not in title: > FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
- squaresmile 6y agoAnother thumb up from me for whatever it's worth. Thanks to FastAPI, I was able to create an API for the community with very little experience, in turn enabling a bunch of downstream apps to be made: a bunch of Discord bots, a few calculators, a few websites. For the front-end, we have a React/Typescript website that is quite easy to extend. The original programmer did a great job organizing the site but I do think FastAPI and React/Typescript helped us along the way.
- hangonhn 6y agoI recently used Starlette, which FastAPI also uses, for a project and absolutely loved it. I went with Starlette over FastAPI because I didn't need a lot of what FastAPI provided for that particular project. I want to start nudging my coworkers into using FastAPI over Flask because some of the async APIs they've started using. FastAPI seems to come with all the things they want out of the box instead of adding a bunch of individual Flask packages. Just for my own understanding, where would FastAPI be appropriate vs. Starlette and vice versa. Thanks!
- lemagedurage 6y agoThe big additions of FastAPI is their pydantic integration which allows for input validation, and their openapi.json generation, which allows for interactive API docs of your web app out of the box. Additionally they provide docs and infrastructure for some extras you might want like authentication and testing.
- BerislavLopac 6y agoYou might like my own little tool based off of Starlette: https://pyotr.readthedocs.io https://pyotr.readthedocs.io ;)
- hangonhn 6y agoThanks! I'll take a look. Much appreciated!
- holler 6y agoI too recently started using Starlette for https://sqwok.im https://sqwok.im and had investigated FastAPI & Responder. Both look promising but I've found that Starlette on it's own is very lightweight, well-designed, and straightforward to work with (coming from many years of flask/django). Some nice features of FastAPI are the automatic response type handling, e.g. "return {'json': 'yes'}" vs "return JSONResponse({})", and the flask-like route decorators. I ended up building the former manually into my project. Both Starlette and FastAPI are worth checking out, especially if you've spent time building python web apis with django or flask in the past.
- rattray 6y agoThis is a Python framework claiming Node/Go-comparable perf. Here's what it looks like: from typing import Optional from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float is_offer: Optional[bool] = None @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Optional[str] = None): return {"item_id": item_id, "q": q} @app.put("/items/{item_id}") def update_item(item_id: int, item: Item): return {"item_name": item.name, "item_id": item_id} That can get you an autogenerated openapi spec and docs, which IMO is pretty awesome. Can anyone comment on how it compares to Django Rest Framework? (Other than presumably being faster)
- mixmastamyk 6y agoNeed to indent that to be readable.
- rattray 6y agoOops, did this on my phone and meant to edit on laptop immediately. Too late now. Here it is: from typing import Optional from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float is_offer: Optional[bool] = None @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Optional[str] = None): return {"item_id": item_id, "q": q} @app.put("/items/{item_id}") def update_item(item_id: int, item: Item): return {"item_name": item.name, "item_id": item_id}
- mlthoughts2018 6y agofastapi is very similar to what you’d get from flask with an API spec tool like flast-restx or flask-marshmallow + incubation time to build your own components & patterns around it + fastapi is faster. So if you are committed to the component tools you already built with flask add ons, stick to flask unless you need the speedup. Otherwise if the project is new or you’re otherwise uncommitted to your existing component tools, switch to fastapi.
- nuclid 6y agoI love FastAPI. It's one of the best documented project I have seen. We're running several latency-critical production workloads in cloud with absolutely no issues. Great work Tiangolo!
- You-Are-Right 6y agoIs this a good choice for realtime websocket projects with many open connections? I found only one simple example in the docs and was not sure, if it will eat too much memory with many clients?
- TeeWEE 6y agoFAST Api is a nice library, but it uses code-based api specifications. It's generates the spec from code. So you need to write your API code by hand first, and do serialization manually... This is an important distinction and might not be what you want. Using spec first API design makes more sense IMHO. You first spec your API (Either in OpenAPI or GRPC or whatever Interface Definition Language you use). This allows Backend and Frontend developers to change the API definition. From there you generate all type-save model objects, client and server stubs, and fill in the implementation with full type hinting. At my current company, we wrote OpenAPI specs first, no need to know Python. And use https://openapi-generator.tech/ https://openapi-generator.tech/ to generate both the Python server, python client and typescript client. We're looking into generate Kotlin and Swift clients too... I'm a big proponent of spec first API design. It's much cheaper to agree on a spec first before you start coding. But it depends on what you are doing. Personally I like GRPC best, since the code generators are top notch. Very good article on this principle: https://medium.com/apis-and-digital-transformation/openapi-and-grpc-side-by-side-b6afb08f75ed https://medium.com/apis-and-digital-transformation/openapi-a... First, stop writing interface code for your APIs by hand. Second, stop writing interface code for your APIs by hand. Third, stop writing interface code for your APIs by hand. We're living in 2021... Every time I see somebody manually mapping an objects to a JSON dictionary I'm crying in the inside. It's like writing machine code by hand.
- ivalm 6y agoJust to further this point. In my group we use several languages (python, java, node) for various services. It is extremely useful to define our spec via openapi and then generate servers/clients that conform to this. We use swaggerhub and their code gen and it's decent for multiple languages.
- BerislavLopac 6y ago> FAST Api is a nice library, but it uses code-based api specifications. It's generates the spec from code. Shameless plug: https://pyotr.readthedocs.io https://pyotr.readthedocs.io ;)
- advance512 6y ago
- petr25102018 6y agoI really like FastAPI. The "fast" in the name means fast development. Using Python types to create endpoints and get auto-generated docs is a joy. If you are looking for examples, feel free to check out mine with websockets [0] or how I run FastAPI with systemd and nginx [1] in production (I run several side projects on FastAPI). [0] https://stribny.name/blog/2020/07/real-time-data-streaming-using-fastapi-and-websockets/ https://stribny.name/blog/2020/07/real-time-data-streaming-u... [1] https://stribny.name/blog/fastapi-production/ https://stribny.name/blog/fastapi-production/
- CoffeePython 6y agoHuge FastAPI fan here. I use it for my projects (and one project even makes enough revenue that I sponsor Sebastián’s work through GitHub sponsors at $250/mo) and it for sure has increased my development velocity. It’s an absolute joy to work with. The automated interactive docs are great for iteration. Type hints as first class citizens is an awesome developer experience that I didn’t think I wanted. Using the auto generated OpenAPI you can even generate client side code and typings to interact with your API. It feels like flask but with lots of quality of life improvements. [1] https://www.vim.so https://www.vim.so
- kowlo 6y agoDo you have any examples of using the OpenAPI to generate client-side code?
- jayjaycross 6y agoI use openapi-generator with FastAPI to do this. It has a lot of languages and libraries you can choose from to generate your client side code in. https://github.com/OpenAPITools/openapi-generator https://github.com/OpenAPITools/openapi-generator
- Cthulhu_ 6y agoI use the openapi-generator as well, but I write the spec first, then generate both client- and server-side models. Not the client itself so much; I don't like the client-side clients it generates much, and the server-side client is barebones at best. (Server is in Go, client is in Typescript)
- djsavvy 6y agoWow, this is cool! I understand if you don't want to give away the secret sauce, but how did you get vim working so smoothly in a browser?
- dternyak 6y agoHave there been any benchmarks done on the websocket side of FastAPI specifically compared to flask-socketio? Especially when scaling horizontally and needing to synchronize across many socket servers? We're building out a product that will maintain large numbers of simultaneously connected sockets, so the "performance" pitch here is pretty compelling.
- tiangolo 6y agoHey! FastAPI creator here Nice surprise to find this shared on HN! It's also great to see so many products/projects and companies using it successfuly in production! I see a bunch of questions related to "how FastAPI compares to X", FastAPI was built from the learnings from other awesome tools, and is built on top of great packages. You can read a lot more about it here: https://fastapi.tiangolo.com/alternatives/ https://fastapi.tiangolo.com/alternatives/ If you have questions or problems, you can ask in GitHub issues: https://github.com/tiangolo/fastapi/issues/new/choose https://github.com/tiangolo/fastapi/issues/new/choose There's also an official Discord chat: https://discord.gg/VQjSZaeJmf https://discord.gg/VQjSZaeJmf And finally, if you use FastAPI, I would love your input in the first user survey (you could win stickers ): https://tripetto.app/run/RXZ6OLDBXX?s=hn https://tripetto.app/run/RXZ6OLDBXX?s=hn
- tasn 6y agoThanks a lot for your work! We recently switched to FastAPI from Django rest framework at Etebase[1] and it's been an absolute pleasure! P.S, if anyone is interested, it took a bit of hacking, but we managed to get two unusual things working: 1. Use MsgPack instead of JSON. It works great and wasn't too much of an effort (the existing libraries are done wrong and don't work well). 2. Use the Django ORM with FastAPI. This was quite hard to do and quite manual as the Django ORM assumes the rest of the Django stack is in use. Etebase is open source[2], so you can just check out how it's done if you are interested. I'm also happy to help if anyone has questions. I really hope we get a good async ORM soon. I'm currently using SQLAlchemy 1.4b1 in a side project, though the typing (and mypy plugin) are unfortunately not there. [1] https://www.etebase.com https://www.etebase.com [2] https://github.com/etesync/server/ https://github.com/etesync/server/
- tiangolo 6y agoThat's very cool!
- leadingthenet 6y agoTortoiseORM is quite similar to the Django ORM, but it's pretty early days, especially with the migrations. Might be a good fit for you guys, though.
- lysecret 6y agoIm using fastapi and lowcode for the fronted and Postgres sqlalchemy for the db. Reeeaallly happy with it.
- muktabh 6y agoHuge FastAPI fan here. I have used FastAPI and friends (tortoise ORM, fastAPI-sqlalchemy and arq) in my recent projects and it has been the most enjoyable web services writing experience in my life. I never had thought python optional typing had any use before I used fastapi.
- polyrand 6y agoI've been using FastAPI for some time, and now I'm using it as a full web framework (not just for REST APIs). I like writing SQL without ORMs, so the combination of aiosql[0] + FastAPI + Jinja2 works great. Add HTMX[1] and even interactive websites become easy. That's in fact the stack I am using to build https://drwn.io/ https://drwn.io/ and I couldn't enjoy it more. Thanks Sebastián for creating it! [0] https://github.com/nackjicholson/aiosql https://github.com/nackjicholson/aiosql [1] https://htmx.org/ https://htmx.org/
- engneeer 6y agogreat, that’s exactly the approach i was looking for to build a web based app without js, only python and html. can you recommend a resource for learning htmx?
- karanbhangui 6y agoThoughts on aiosql vs encode/databases[0] or encode/orm[1]? Same creator as starlette (under the hood of FastAPI) [0] https://github.com/encode/databases https://github.com/encode/databases [1] https://github.com/encode/orm https://github.com/encode/orm
- splatcollision 6y agoI picked FastAPI when I started a large project last year, when I was looking for something a little nicer than Flask for just an API server. FastAPI feels like a damn cheat code, it's so well designed with the Pydantic models as input validation, the flexibility, the built in OpenAPI docs, on and on. Love it!
- CSactuary 6y agoActually just started on a new project with fast api last week. Really liking it! I think some of the other frameworks I’ve worked with in the past have too much of their own abstraction built in to the point that it’s difficult to understand the fundamentals of how the application is working. Fast API excludes unnecessary abstractions, makes it easy to use outside libraries, and feels a lot more intuitive. Less learning the docs and more coding. Thanks to Tiangolo for your efforts!
- TheGuyWhoCodes 6y agoI looked at FastAPI while back for an API for a machine learning inference service (and you'd see a lot of blog/medium posts for that). The syntax and documentation is really good and the docker examples are great for fast startup. The only problem is that because FastAPI isn't process based some machine learning libraries (Tensorflow for example) don't really play nice and you'll get random errors or funky results, especially under load. Obviously one solution is to use Tensorflow severing (and deal with that craziness) and let the FastAPI do the routing/data processing but I bet there are production machine learning products using FastAPI spawning random numbers and the developers are oblivious to the problem.
- jeffnappi 6y agoIdeally ML tasks would get executed by background tasks e.g. Celery and use polling or a non-blocking event loop. It's generally not preferred to run such intensive process work inside the context of a web request.
- TheGuyWhoCodes 6y agoIt really depends on your API clients and your latency. Celery is fine for long running or batching, the queue and the fact you need to store and retrieve the results from somewhere else isn't really ideal. Non blocking events loops (and reactive requests) really like small tasks and even scream at you if you are above their thresholds. Honestly I see a bright future for apache arrow flight but I think It's a bit immature right now. But my main points is that 80% of the blog posts about FastAPI are for machine learning and people will just copy the code, run one or 2 requests see that it's fine and move along...
- m_ke 6y agoI also ran into some performance issues with model serving using FastAPI and ended up using Ray Serve to handle properly distributing the workload and batching requests. With a bit of work I was able to 10x the throughput and cut down response time in half. Ray uses apache arrow plasma store to avoid the copy and serialization costs that usually come with multiprocessing in python. https://docs.ray.io/en/master/serve/index.html https://docs.ray.io/en/master/serve/index.html
- wiredfool 6y agoI've just put together a couple of APIs, pretty simple things, but FASTApi made the first one (a bunch of selects) go together super quick (except for matching a legacy query parameter structure that is only questionably legal), and the second one (call outs to subprocess.check_foo) was going well until I tried to access a raw post body from a sync context. As far as I can tell, it's just not possible with Starlette, so after spending as much time as I spent on the rest of the API, I ripped out FASTApi and dropped in flask. There's a lot more messing with parameters, and it's not as clean, but it does work without dropping subprocess.
- m_ke 6y agoYeah I also just ran into that issue a week ago. Had to look for awful hacks to try to get around it, ended up using Ray Serve to offload the processing to a background worker.
- bkovacev 6y agoI'd love to give this a go - we use Django/DRF extensively and we love it, however sometimes serialization performance is awful. Are there any speed ups compared to Django in serialization speed?
- yeswecatan 6y agoCheck out serpy if you need more performant serialization.
- f430 6y agoDoes FastAPI work with AWS Lambda + API Gateway?
- kylebarron 6y agoIt does when paired with mangum https://github.com/jordaneremieff/mangum https://github.com/jordaneremieff/mangum
- f430 6y agois this like Zapper (takes flask, django to serverless automatically) ?
- yagizdegirmenci 6y agoYou might want to check this out. Mangum: AWS Lambda & API Gateway support for ASGI - https://github.com/jordaneremieff/mangum https://github.com/jordaneremieff/mangum
- holler 6y agoAssuming yes as I'm running https://sqwok.im https://sqwok.im (uses Starlette) on aws lambda with apigateway using Mangum
- jgalt212 6y agoWe have been tinkering with Falcon. My sense is that Falcon may be better if your server is doing computations rather than just serving database requests. Am I thinking about this correctly, or can FastAPI work well for compute heavy jobs without too much tinkering (i.e. forking the main thread)?
- adamcharnock 6y agoIf you like using type hints in this way then you may be interested in Lightbus, the eventing & RPC framework I wrote: https://lightbus.org https://lightbus.org
- conqistador 6y agoI want to use redis to cache response output and large database retrievals with FastAPI. But there isn't any documentation on how to do that or any googleable resources
- bambam24 6y agoI close the window when I read the word “python” who is with me?
- systematical 6y agoI've used it to inform what I am doing in PHP, so thanks FastAPI, meet mixerapi.com
- gourneau 6y agoI just want to chime in to say at my organization we are using FastAPI for a production service and have had zero issues. Solid stuff!
- sandGorgon 6y agoI love Fastapi - but we are struggling with performance benchmarks using a real life sqlalchemy + postgresql setup. There are others who are having similar issues - https://github.com/tiangolo/fastapi/issues/1825 https://github.com/tiangolo/fastapi/issues/1825 and https://github.com/tiangolo/fastapi/issues/1562 https://github.com/tiangolo/fastapi/issues/1562 . Fastapi is a wonderful developer experience, but needs some work around the production/performance side of things. Which is sorely missing as of right now.
- deleted 6y ago[deleted]
- antidocker 6y agoFastAPI is very slow. I can make much faster API in C++ now given C++ more like JS and easy to use.
- pknerd 6y agoFastApi is quite awesome. I recently discovered it and covered on my blog for beginners [1] Http://blog.adnansiddiqi.me/tag/fastapi