Understanding why to choose microservices

Let's look at some of the reasons why you might want to choose microservices for your applications. Not every application should utilize microservices, as you will see in the next section. Very distinct reasons warrant the use of microservices. Let's take an example to justify why we want to choose microservices.

Let's pretend you want to develop a simple e-commerce app. If we say that there are three different elements of microservices in an app, User, Product, and Order. The app should cover the following features:

  • User: Log in
  • User: Register
  • User: Change addresses
  • User: Change payment methods
  • Products: Show the list of products in a category
  • Products: Show details about an individual product
  • Order: Submit an order of products
  • Order: Submit payment for an order

You could develop the backend for such an app as a monolith, of course. It would, without a doubt, be a rather big application and require many models and controllers. But if you were to develop the same app with microservices, you could end up with three more flexible packages, such as the following:

  • User Manager
  • Products Manager
  • Order Manager

You can now enjoy the following benefits from using microservices:

  • Effective team management
  • Reusable code base
  • Flexible scope of functionality
  • Maintainability
  • Scalability
  • Mixed stacks

Let's dive into each of these sections now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.102.189