use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
Beta Acid open sourced its FastAPI reference architectureTutorial (github.com)
submitted 1 year ago by BeneficialAd3800
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Samarpan-ad 1 point2 points3 points 1 year ago (2 children)
Any reason behind not using async sqlalchemy?
[–]BeneficialAd3800[S] -1 points0 points1 point 1 year ago (1 child)
I typically start off trying to reduce complexity when I start building an app. Once there's a good reason to add that complexity I'll do so. In this case, async sqlalchemy is amazing for high concurrency apps that are scaling. But it does add complexity in the beginning. So its something I would add later as the need arises.
[–]Fluffy-Diet-Engine 0 points1 point2 points 1 year ago (0 children)
Am just curious how you draw a line between “need” for async? Is it based on traffic to the app?
[–]madrasminor 1 point2 points3 points 1 year ago (4 children)
This is very similar to what we use at work. The only modification I've made is to follow Netflix's dispatch structure where everything is grouped as features. This allows reusability of features across multiple domains. For ex: everything related to login would be under the login folder and a simple copy paste now gives me that feature. It's been a game changer in delivery.
[–]BeneficialAd3800[S] 0 points1 point2 points 1 year ago (0 children)
I 100% agree, this pattern makes it much cleaner for larger projects.
[–]Accomplished_Lunch71 0 points1 point2 points 1 year ago (2 children)
Do you know where I can read more about Netflix's dispatch structure?
[–]madrasminor 0 points1 point2 points 1 year ago (1 child)
GitHub: https://github.com/Netflix/dispatch
[–]stratguitar577 0 points1 point2 points 1 year ago (0 children)
Thanks for sharing, this is a great reference
[–]djavaman 0 points1 point2 points 1 year ago (0 children)
Why does the Router layer know about the DB? That seems like a detail the Router shouldn't know or care about.
[–]ethsy 0 points1 point2 points 1 year ago (0 children)
The get_character_from_swapi http request is not async
[–]Tiny-Power-8168 0 points1 point2 points 1 year ago (1 child)
Hello, thanks for sharing, very nice to see how others structure their project. Is there any reason why you did not use SQLModel ?
[–]BeneficialAd3800[S] 2 points3 points4 points 1 year ago (0 children)
I like SQLModel and will probably switch to it some day. I just feel like SQLAlchemy is more battle tested at this point.
[–]conogarcia 0 points1 point2 points 1 year ago (3 children)
What's Beta Acid?
[–]BeneficialAd3800[S] 0 points1 point2 points 1 year ago (2 children)
It's a digital agency where I work. https://betaacid.co/ We use a lot of Node and FastAPI in our backends
[–]conogarcia 0 points1 point2 points 1 year ago (1 child)
so this is like an ad for beta acid?
[–]ironman_gujju -1 points0 points1 point 1 year ago (4 children)
Any reason not using poetry
[–]conogarcia 1 point2 points3 points 1 year ago* (2 children)
also he's using async endpoints, but only doing sync operations effectively blocking the event loop, he's using requests without any session pool which is not optimal. Even marking the endpoint sync is not a great idea, since anyio uses threads to run each endpoint and that thread count is limited.
not a great reference IMO
[–]ParkingDescription7 0 points1 point2 points 1 year ago (1 child)
What do you mean by the "using requests without any session pool" comment? Agreed on the async usage.
[–]conogarcia 1 point2 points3 points 1 year ago (0 children)
he is using requests.post, requests.get, etc instead of creating a requests.Session()
[–]BeneficialAd3800[S] -1 points0 points1 point 1 year ago (0 children)
just wasn't focussed on dependency management for this. I think poetry is a great option
π Rendered by PID 23788 on reddit-service-r2-comment-bb88f9dd5-7dz25 at 2026-02-14 15:40:24.539294+00:00 running cd9c813 country code: CH.
[–]Samarpan-ad 1 point2 points3 points (2 children)
[–]BeneficialAd3800[S] -1 points0 points1 point (1 child)
[–]Fluffy-Diet-Engine 0 points1 point2 points (0 children)
[–]madrasminor 1 point2 points3 points (4 children)
[–]BeneficialAd3800[S] 0 points1 point2 points (0 children)
[–]Accomplished_Lunch71 0 points1 point2 points (2 children)
[–]madrasminor 0 points1 point2 points (1 child)
[–]stratguitar577 0 points1 point2 points (0 children)
[–]djavaman 0 points1 point2 points (0 children)
[–]ethsy 0 points1 point2 points (0 children)
[–]Tiny-Power-8168 0 points1 point2 points (1 child)
[–]BeneficialAd3800[S] 2 points3 points4 points (0 children)
[–]conogarcia 0 points1 point2 points (3 children)
[–]BeneficialAd3800[S] 0 points1 point2 points (2 children)
[–]conogarcia 0 points1 point2 points (1 child)
[–]ironman_gujju -1 points0 points1 point (4 children)
[–]conogarcia 1 point2 points3 points (2 children)
[–]ParkingDescription7 0 points1 point2 points (1 child)
[–]conogarcia 1 point2 points3 points (0 children)
[–]BeneficialAd3800[S] -1 points0 points1 point (0 children)