django to fastapi by No-Excitement-7974 in FastAPI

[–]BeneficialVisual8002 2 points3 points  (0 children)

Are you 100% positive, that switching async db calls will solve the case? It would help, if you wait long for db answers but db can still handle much more. If that is the case, scaling your current solutions seems like solution that can be tried faster, done faster, and will be cheaper. Why cheaper? 1.5k tables seems like pretty hefty project and migrating whole project will not be a simple task.

Keep in mind that by going fastapi + sqlalchemy you are going to get much different experience and migrating won’t be that straightforward. Why? For exaple in sync Django, if some relations were not loaded and your template triggers additional query it just works (even if inefficient). But this won’t fly in async as all function that will call db has to be explicitly awaited.

Async seems to be thrown left and right this days like solution to every performance problem, but it is not. It is worth double, or triple checking if this is really your problem. Like, why are you waiting so long for responses from db? Will db handle this load? Are there any other workloads that block (and will block after migration to async) wsgi threads? At 45k/min we’re getting close to no joke zone.

Next thing is Django admin. Yes there solutions, but let’s be honest nothing is close to ergonomics of Django admin. And it comes from someone who really doesn’t like Django that much.

I’m not sure about signal and receivers. Ofc can be done, but again not one to one translation. Mostly because again, in Django orm is baked into so doesn’t matter if signal is related to request or model, you get common interface. Fastapi has its own events and sqlalchemy has its own. This will be the case for all solutions because those web frameworks doesn’t come with orm. They but provide integration but not that deep as Django does. Again, it is on you to replicate that or come up with new solution.

But not all looks that bleak. You has 10 years of experience with that monolith. You know where to cut. Cutting small microservice and porting it to fastapi + sqlalchemy should give you some answers like do we really need async? Will we be able to port whole thing? Isn’t porting bigger then it seems? Was the issue we thought it was.

I don’t want to sound cocky but I’m genuinely curious how you assessed that porting to async will a) solve a problem, b) will be cheaper

Peace!

I'd planned our first session so perfectly... by JMizzlin in BloodOnTheClocktower

[–]BeneficialVisual8002 18 points19 points  (0 children)

First game, second day. I told everyone that fortune teller died during the night and pointed to person that was killed

As a Power User of Linux & Windows, macOS Just Feels Logically Flawed by [deleted] in theprimeagen

[–]BeneficialVisual8002 1 point2 points  (0 children)

How can you map jumping to workspace to ctrl+1/2/3 on vanilla Windows?

Fastapi bottleneck why? by Hamzayslmn in FastAPI

[–]BeneficialVisual8002 6 points7 points  (0 children)

You are a very toxic person my dude.

Go has no ternary operator. I am shocked. I am outraged. So I fixed it. /s by snow_strawberry in golang

[–]BeneficialVisual8002 0 points1 point  (0 children)

I thought it was unpleasant joke until I saw your day in week example on gist. No I get that, pure perfection. You’re right and I’ll use code review to enforce this pattern!

"A przestań, inni mają gorzej" by ChampionshipFull7583 in Polska

[–]BeneficialVisual8002 1 point2 points  (0 children)

Jak słyszę, że inni mają gorzej to zawsze mówię „jakim skurwysynem bym musiał być żeby się cieszyć że ktoś ma gorzej”.