Thank you for your insightful question!
You're right that SQLAlchemy offers an async session maker, which is particularly useful for fully leveraging FastAPI's asynchronous capabilities. In the article, I chose to use a sync session maker mainly for compatibility reasons with certain modules or extensions that don't yet support async operations. Additionally, in scenarios where database access isn't the primary performance bottleneck, the difference between using sync and async sessions might be negligible.
However, if your application heavily relies on database operations and you want to maximize performance through asynchrony, the async session maker would indeed be a better choice. It ultimately depends on the specific context and requirements of your project.
I hope this answers your question! Feel free to ask if you have any more.