Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 2.4 KB

README.md

File metadata and controls

34 lines (26 loc) · 2.4 KB

Mtv - A representational project for microservice pattern

This project makes use of orchestaration based SAGA pattern. There are two major components in this :

The Frontend stands as a standalone gateway between the requests and the services. Here, the received HTTP requests are transformed to Nameko RPC calls The RPC calls put the requests to a middleware message broker (RabbitMQ) which is then consumed by the services. The services are completely separated from the frontend, making scaling easier.

Below is an architecture diagram of the same,

Architecture image

Thanks to docker, this complete micro service architecture can be spun in seconds for demo.

Run the service:

  • Make sure you have install docker and docker-compose. Follow docker installation and docker-compose installation and enable the services
  • cd to the project directory.
  • Run the following command.
    docker-compose up --build 
    This might take some minutes initially as it downloads image and build images. One it get spun, the entire components along with service will be ready.
  • Open-api(swagger-ui) is being used to show each service API document. It allows to test the services on the fly as well. To access the swagger docker for stream service go to http://localhost/swagger

Frontend

The frontend is as mentioned a flask app, which get the http API requests from client and these requests are transformed to nameko RPC calls, using nameko standalone RPC. which talks to the message broker.

Stream Service

The stream service is a Nameko service that exposes api to get, add, delete movies. The http://localhost/swagger directly load the docs of the Stream service. The underlying database is Mysql. This is an sqlalchemy ORM based. Its allows to easily create the db schema and not to write custom queries. Also marshmallow is used to work with ORM for serialization, de-serialization of data from and to the mysql DB.

-@github/sarathsprakash