Building Microservices with FastAPI — Part I — Introduction to the FastAPI Framework

<p>Without a doubt, microservices are one of the hot topics of modern IT landscape. Their popularity enhanced with the prevalence of cloud technologies and containerization of applications. Therefore, transformation of legacy monolith applications to this architecture and architecting new projects as such stays on top of every enterprise&rsquo;s to-do list. Naturally, microservice mindset is not a silver bullet and introduces new difficulties. A comprehensive discussion about pros and cons of microservices is out of the scope of this story, however&nbsp;<a href="https://www.atlassian.com/microservices/microservices-architecture/microservices-vs-monolith" rel="noopener ugc nofollow" target="_blank">this article</a>&nbsp;is quite neat on the subject matter.</p> <p>This series consists of two stories, first one will be a brief introduction of FastAPI framework. Some key components and features will be summarized in here. In the second one, I&rsquo;ll be extending an open-source microservice project developed with FastAPI.</p> <h1><strong>What is FastAPI?</strong></h1> <p>FastAPI is a Python framework which facilitates REST API development. It is quite new compared to other giants such as Django and Flask that the project started in 2019. However, it gained a huge popularity among community. Considered in web frameworks, at the time of writing, it is the third popular (based on the Github stars and forks) after Django and Flask.</p> <p>Wisely,&nbsp;tiangolo&nbsp;(creator of FastAPI) did not put effort on reinventing the wheel but instead his contribution was to wrap an async ASGI framework (starlette) and an async web server (uvicorn) in an orchestrated way to provide a fully-featured async web framework.&nbsp;His evaluation of history and comparison with alternatives&nbsp;gives a more complete look.</p> <p><a href="https://medium.com/@emrah-t/building-microservices-with-fastapi-part-i-introduction-to-the-fastapi-framework-a7488cdbea">Read More</a></p>
Tags: API ASGI