Elaborate Microservice async example with FastAPI, RabbitMQ, MongoDB and Redis — part4.

Anders Wiklund
14 min readMar 31, 2023
Image created by the author

Introduction

This is part4 in the series. This part talks about the PaymentService architecture and design patterns that are used and the resulting directory structure of the implementation.

Here’s a brief outline of the article parts:

  1. Introduction and installation of required components.
  2. OrderService Architecture and Design patterns.
  3. OrderService usage of RabbitMQ.
  4. PaymentService Architecture and Design patterns (this article).
  5. FastAPI enhancements.
  6. Putting it all together.

Architecture and design patterns

I will mention the architectural and software design patterns that I have used, but not go into any detail of how they work. That is outside the scope of this article.

The structural pattern that is used is the Hexagonal architecture pattern. That is used for splitting the code into manageable blocks of code that’s layered, loosely coupled and the…

--

--