Microservices is one of the top buzzwords nowadays. It's easy to understand why— in the growing
software industry, where the amount of services, data, and users is increasing exponentially, we need a way to build and deliver faster, decoupled, and scalable solutions.
Why are microservices good? Why use them? With growing demand, the need to deal with each module separately has increased. For example, in your customer application, perhaps user information needs to be scaled differently from the address information.
In the monolith paradigm, you need to deal with it atomically—you build a cluster for the whole application or you scale your entire host up (or down). The problem with this approach is that you can't focus your effort and resources on a specific feature, module, or function— you are always guided by what is needed at that moment.
In the microservice approach, you do it separately. Then, you can not only scale (up or down) one single unit in your application, but you can also separate your data for each service (which you should do), separate technology (best tool for the best work), and more.
Other than scale technology, microservices are made to scale people. With a bigger application, bigger architecture, and bigger databases, also come bigger teams. And if you build your team like a monolith application, you are probably getting likely results.
So, as the application is split into a few (or a lot of) modules, you can also define cross-functional teams to take care of each module. This means that each team can have its own programmer, designer, database administrator, system administrator, network specialist, manager, and so on. Each team has responsibility for the module it is dealing with.
This brings agility to the process of thinking about and delivering software and then maintaining and evolving it.
In this chapter, there are some recipes to help you to get started with microservices or go deeper into your ongoing project.
This chapter covers the following recipes:
- Building microservices from a monolith
- Building decoupled services
- Building an automated pipeline for microservices
- Determining the state of a microservice by using the MicroProfile Health Check API
- Generating and/or monitoring metrics with the MicroProfile Metrics API
- Exposing API documentation using MicroProfile OpenAPI