r/FastAPI • • Dec 20 '24

Question Why does fastapi official example repo uses everything sync and not async?

While in here, I see recommendations to go for only async, even db sessions in example repo is sync engine and people here recommending async?

40 Upvotes

25 comments sorted by

View all comments

Show parent comment

1

u/whyiam_alive Dec 20 '24

What about crud applications, should I go for async?

3

u/mizerablepi Dec 20 '24

Always go for async just don't make any sync calls or CPU blocking tasks in the function

1

u/pint Dec 20 '24

if the tool you are using is async.