This article does not aim at describing frameworks and architecture, as they are already well documented. Rather, it is intended for those who start working with microservices and Project Reactor, and describes the main features of these technologies and what they will have to deal with and work with.
Unlike monolithic, microservice architecture is based on the allocation of small independent software services, each of which implements a separate business function. If everything is connected in a monolith (and in case of failure of one function the others can “fall off”), then microservices can provide flexibility and stability of the system. Large IT solutions can contain dozens of microservices in their architecture, and a separate independent team can work with each of them.
Example
Consider the case study from practice. The insurance company contacted us to upgrade its online application with a flexible microservice architecture. We were faced with the task of implementing cashback in the application, that is, accruing bonus points to the user for the purchase of an insurance policy.
At first glance, the task looked simple.
For each paid (extended) policy to accrue to the user a certain cashback of X% through the accounting service. The user should have access to information about the received cashback.
Upon reaching a certain total cashback, automatically transfer funds to the client through the accounting service. The payout history should be available to the user.
The main project used the Kafka message queue as a means of exchanging information between microservices, and also as the only permanent replicated information store.
When you need to implement certain functions on microservices, you always need to keep in mind the possibility of horizontal scaling. The code should work not only in a multi-threaded environment, but also in the case when several containers with a microservice are launched.
We also add that the clients of such an application are supposedly unlimited. And many of them are mobile, i.e. relatively slow.