Академический Документы
Профессиональный Документы
Культура Документы
Data access becomes much more complex when we move to a microservices architecture.
That is because the data owned by each microservice is private to that microservice
and can only be accessed via its API. If multiple services access the same data,
schema updates require time-consuming, coordinated updates to all of the services.
Another major issue with microservices is network failure. If any service is down
due to a network issue or any other reason, then one service cannot communicate
with other and the entire transaction will fail. For example, if Service A is
trying to communicate with Service B when B is already down, then the transaction
fails.
Event Messaging
Event Driven Architecture is called messaging systems. A message is simply an event
or vice versa an event becomes a message. The concept of an event-driven system is
that it should cause everything that is interested to be notified of these events
that could benefit from knowing about it. Thus, the earliest real-time event-driven
systems came up with the notion of publish/subscribe.
Image title
A pub/sub system should support a mechanism for publishers to find out about new
subscribers and subscribers should be able to find the publishers of information
immediately upon their availability.
As a subscriber, you would need to know that you can be guaranteed to receive all
messages from the publishers in the time sequence they occurred, if desired
(reliability and security). All subscribers should be notified of the event as
close to the same time as possible.
The Message Broker acts as a key mediator between publisher and subscriber. The
purpose of a broker is to take incoming messages from applications and make them
available for the subscriber to fetch the messages. The messages will be retained
by the broker until it is fetched by the corresponding subscribers. The most
popular message brokers are Apache Kafka, Apache ActiveMQ, RabbitMQ (Mozilla Public
License), Redis, etc.
Summary
In this blog post, we discussed the challenges of distributed data management in
microservices and how Event-Driven architecture helps to address these issues using
the Event Messaging pattern.