Posts

Showing posts from February, 2023

Watch Notification Pattern

Image
There is an external configuration server which contains configuration details of services. Now whenever there is a change in any configuration the services need to be actively listening for configuration changes, This creates an always on connection consuming resources where not necessarily required. Or a broker is required to continuously publish the changes to different services making the overall infrastructure heavy. Problem : Notify services whenever configuration value changes Solution : Watch notification pattern. A broker less approach to publish changes across services Prelude to watch notification service : Before we divulge into the watch notification pattern lets have a look at attempts already done to solve the problem of notifying services Service Broadcast Pattern Actors:  1. A group of services 2. External config server 3. A broker Concept : All services are subscribed to a broker. The external configuration service publishes  a ch...

Event Forwarding Pattern

Image
In an event driven system there are different points at which message loss could happen resulting in data loss. The Event Forwarding pattern is one of the solutions to avoid this. Like every other architectural pattern this has its own pros and cons. While this pattern ensures data integrity in all scenarios, the overall performance and throughput of the system decreases by a third, according to some estimates. Contents: 1. Challenge  2. Concept 3. Points of Failure 4. Code Implementation   Let's understand the problem and proposed solution. Challenge: Make sure that no messages are lost when passing data from one system to another. Pattern used :  Event Forwarding Pattern Concept : For illustrating the problem and pattern lets consider two Services A and B, along with a event broker and database. Service A publishes events into Event Broker. Service B subscribes to the said events, processes them and then stores the result in a database.  Before applying any pat...