Author : Guest
Total Views : 309
Posted On : Sun, Feb 18, 2018
Updated On : Mon, Feb 19, 2018

What are Micro Services - Part 2

As we have understood a bit about micro service term in part 1. Now I will elaborate technically with real time example.
Suppose we are developing an Online Room Booking system. so, first of all, we need to define essential parts and provide services for the application.

Such type system will have multiple modules-

  1. Tourist End (who will make booking)
  2. Hotel or Home (where will be book a room)
  3. Application Admin part (To manage such services)

#1 Tourist Activities

  • Come at the system, put required details (location, how many rooms and how many persons to stay).
  • Find rooms list and check facilities like (TV, wifi, vehicle service, lunch etc.).
  • Make booking and done payment
  • Check the status of room booking by SMS, Email.

#2 Hotel or Home provider activities

  • Make sure all services are available, which are mentioned on portal.
  • Check/Update availability of rooms.
  • Get booking status with complete detail (how many persons & rooms and foods etc.)
  • Promotions like discount, food and other services

#3 Application Admin Activities

  • Manage room listing and make separation as per room from Home or Hotel
  • Manage their prices and discounts and available services
  • Manage booking details and able to edit them
  • Manage booking statuses
  • Handle any dispute cases
  • Payment settlement and release it.
  • Check security and run health checking cycle for the whole system.

Above I have mentioned main essential things, now we will think about tech system. Suppose there come 1 lac requests for booking, need to send 10 notifications per request and need to update rooms status and make payments secure, it has happened each second. So we need highly available service server. Otherwise, we will lose customers if the system is crashed or make delay responses.

So first we need to split our system services into small jobs and have to develop distributed approach

  1. Display rooms list when customer make search on portal
  2. Process booking steps
  3. Notifications by SMS and Email
  4. Inventory section
  5. Marketing section

All above points will have APIs and communicate with different devices like mobile, web browser and internal servers etc. because of Inventory section is not directly related to Notifications and Marketing section is not related directly with Process booking systems. So we will make separate services even hosted on different servers.

Maybe all sections will have different data sources also like NoSQL (Mongo DB) or Relational DB (MS SQL) and to handle the async request by NodeJS environment. For searching need to develop the GraphQL structure to making efficient result and different languages too.

And all APIs will be accessible after called a Gateway API which will check security points and provide Token to communicate with small services APIs.
So main services will be distributed and Gateway API will call for every request to check request is valid and handle load balancing internally. So Gateway API plays role as mediator for security and load balancing at the server level and other API level and it makes request calling optimistic.

Application Distributed Diagram

To use micro-services structure, increase servers and different modules in an application and need to manage deployment by a system. So it is increased system cost.

So the conclusion is, to make system availability and handle bulk requests without any delay, the system should be developed by micro service concept.

So guys if you are thinking to develop a huge application then microservices are a really good choice. Use them an and make fun.

Thank you for reading my thoughts