DEV Community

Visakh Vijayan
Visakh Vijayan

Posted on

Microservices simply

Microservices have been a topic that has been revolving in my mind for some time. I wanted to find out what the big deal is behind all of that.

So here is what I understood from the Internet.

  • Microservices is an architecture where we create a system with loosely coupled services each that can be scaled in isolation.
  • Microservices talk to each other via protocols like HTTP, gRPC etc.
  • Each MS can be individually deployed and has its own database. So total isolation. But it comes with the overhead of managing each one too. There is also the problem that now databases can't have foreign key relationships.
  • It is a good way to show separation of concerns as the microservices are totally isolated.
  • The key component is the API gateway which acts as a proxy to the services. Everything hits the gateway and is then routed.
  • Last but not the least, it is not meant for small projects. It is best for large teams with each micro-team working on a micro-service.

So I went out to make it happen and get over with the fuss once and for all. Like always I went ahead with my most favourite thing in the world - a todo application.

Here is the architecture

  1. User Domain - a user micro-service that creates and gets users.
  2. Todo Domain - a todo micro-service that adds and fetches todo items for the users
  3. API Gateway - a gateway that acts as a proxy and routes requests.

Here is the code
Github Repository - https://github.com/visakhvjn/microservices-express

Top comments (0)