Thursday, May 17, 2018

MIcroservice Case study

Microservices could be implemented in several way. In this case below is the stack used.


  • Django
  • Flask
  • Node.js
  • mysql
  • mongo
  • docker
  • kubernetes
  • ubuntu 


In this usecase API searches keyword "search_term" in the available public repositories and displays top 5 active repositories
There are 3 app services here i.e., Django (DAPP) service, FLASK(FAPP) service, NODE.JS(Nodeapp) service
There are 2 database services Mysql(ms-mysql)service and Mongo(ms-mongo)service.

All five docker images are available at location Docker Hub

Preparing the environment

Install docker and kubernetes as mentioned in the location 

Checkout and start kubernetes files from github location

Starting and Stopping services

Start the kubernetes services/pods/deployments with below steps with the files located in dhub
sh ./start0.sh
sh ./start.sh

For stopping kubernetes services/pods/deployments use below step
sh ./stop.sh

Consuming APIs

DAPP consumes FAPP, MySql services and exposes API
http://<HOST-IP>:8000/search/?search_term=flask

FAPP consumes Mongo service and exposed API
http://<HOST-IP>:9000/api/v1/githubsearch/?search_term=kubernetes&employee=nexi_user3

Nodeapp consumes Mongo service
http://<HOST-IP>:8081/