Icon
Icon
2
Last Updates
Icon
New Project
Rebranding Swift Sports with bold visuals and hyper speed interactions.
Mar 12
New Project
Showcasing our latest work for Noire, a brand that breathes fresh life.
Mar 12
New Post
Exploring pixel art aesthetics and code for modern digital experiences.
Mar 12
New Project
A look behind the scenes of the photo shoot that defined a luxury scent.
Mar 12
New Post
Read how our team stays productive and inspired anywhere on the globe.
Mar 12
New Post
Pushing furniture design outside its natural habitat for a unique view.
Mar 12
View all
View all
Icon
Explore our pages
Icon
Home
[01]
About
[02]
Cases
[03]
News
[04]
Contact
[05]
Contact
[05]
Office
149 Zelena St

Lviv, Lviv Oblast 79035
Ukraine

Social
Instagram
LinkedIn
Clutch
Medium

The Power of Events: Mastering Event-Driven Communication (Part 2)

Category:
Articles
Date:
March 13, 2025

In the previous part we’ve learned about the concept of an event, how to start thinking in terms of events, and what are the benefits of using the Event-Driven approach. We have all agreed that events are the core building blocks that enable asynchronous, loosely coupled communication between system components. But how do we implement an event in the first place? Several ways exist to design Event-Driven systems, each suited for different use cases.

‍

Observer pattern

‍

Observer, also called Event-Subscriber or Event-Listener, is a behavioral design pattern that lets you define a subscription mechanism to notify multiple objects about any events that happen to the object they’re observing. It is a simple solution, with one particular benefit — it doesn’t require any middleware to connect publishers & subscribers.

‍

‍

void notifyAll() {
  for (var s: subscribers) {
    s.handleEvent(state);
  }
}

‍

void doStuff() {
  state = new State();
  notifyAll();
}

‍

var publisher = new Publisher();
publisher.subscribe(new FirstSubscriber());
publisher.doStuf();

‍

Advantages

‍

  • Simplicity. Observer pattern can be implemented with existing Object-Oriented programming language;
  • It doesn’t require any middleware;

‍

Disadvantages

‍

  • Events are not durable;
  • They only exist within the memory of one process;
  • As a system grows it becomes ever so difficult to manage many publishers and subscribers;

‍

Use Cases:
Works well for in-memory event handling (e.g. UI updates, internal service events). It’s a good choice for monolithic applications of moderate complexity.

‍

Such a solution has quite a few limitations and often it will not take that much time until you start looking towards integrating the Event Broker.

‍

Event Broker

‍

Event Broker is an external technology that works by publish-subscribe model or Pub/Sub across distributed systems, which means that multiple micro-services can communicate asynchronously without being directly dependent on each other.

There are many available event brokers: Apache Kafka, RabbitMQ, Apache Pulsar, Amazon SQS, Azure Service Bus, etc. Generally, they all consist of two parts:

‍

  • Data structure for storing events (Usually it’s a Queue).
  • Routing mechanisms (Topics, Exchanges, etc.) that determine which message where should go. These are mechanisms that provide the decoupling of software components, not the queue itself.

‍

Advantages

‍

  • Loose coupling and asynchrony. We’ve already been introduced to these two concepts in the previous part. Publishers and subscribers do not need to know about each other. Publishers can work without waiting for subscribers to process events.
  • Durability. The event message persists within the queue, which means you can retry this event in case of failure.
  • Scalability. Event brokers can handle high message throughput. Most modern event brokers support horizontal scaling, which means you can add more nodes to increase throughput without affecting publishers.
  • Support of multiple consumers. A single event can be processed by multiple independent consumers allowing one to create workflows where one event can cause an entire chain of actions.

‍

Disadvantages

‍

  • More infrastructure to manage. By introducing an event broker you are adding a new software component that you need to configure and maintain.
  • Increased latency in comparison to direct calls.
  • Requires careful schema design. When you use an event broker you can not just change the event schema and deploy your service. Consumers may still receive messages with an old schema, therefore they need to know how to handle them.
  • Event order and duplicate admission. Some event brokers do not guarantee strict event order by default or provide “at least once” delivery methods, which means that in certain cases messages can be read more than once. All this requires event listeners to be idempotent.

‍

Use cases:
Event brokers work well for large-scale systems that require complex asynchronous communication between multiple microservices. You have to be careful though because added complexity may outweigh the benefits of using the technology.

‍

‍

Event Bus

‍

Event Bus is another Event-Driven approach that provides a centralized mechanism for managing event distribution within the system.

‍

It may be built on top of message brokers such as Kafka, Amazon Event Bridge, or Amazon SQS/SNS setup. You can also configure the event bus to communicate directly. There are many libraries that provide this functionality out of the box such as Spring-Boot’s ApplicationEventPublisher.

Event buses have the following key characteristics:

‍

  • Centralized architecture. Usually, Event Bus acts as a highway through which all the events in the system are routed to their many destinations.
  • Many-to-many communication. Multiple services can subscribe to the same type of event and react to it independently.
  • Subscription filtering. Subscribers usually perform some sort of subscription filtering when they tap into the event bus.
  • Events in the event bus are ephemeral. Due to event buses’ multicast nature, you can not really persist the message as it affects all the subscribers of this event. This problem may be mitigated by combining event buses with event brokers, therefore creating a safe point for an event as shown in the picture below.

Advantages

‍

  • Allows to broadcast / multicast events.
  • Simplified event handling due to its centralized architecture.
  • Extensibility and maintainability. One particular advantage an event bus has over an event broker is its extensibility. By introducing a new event into a system you just need to write the code that publishes an event and routes it to the right consumer. Whereas in the case of event broker, you need to declare queues with corresponding topics/exchanges, etc.

‍

Disadvantages

‍

  • Lack of durability.
  • Event bus indeed does simplify event handling but you still need to beware of overusing events. If everything becomes an event, managing the flow of events can become chaotic and may lead to unpredictable behavior.
  • Single point of failure. The event bus is a single infrastructure unit and when it’s down, it makes the entire system useless.

‍

Use cases:
Event buses work well when you have many small applications (microservices architecture) and/or when you have a complex network of events and you expect multiple services to react to the same events.

Event Streams

‍

Event Stream is a continuous flow of events that are coming in real-time but should be processed sequentially.

‍

  • The key difference between event streams and event brokers is that messages are not deleted after they are consumed.
  • Unlike traditional message queues, events stored in streams can be read as often as needed.
  • They are also immutable, which means you can only publish new events, existing ones can not be changed.
  • Events don’t stay forever. Usually, there are some configurable retention policies that determine when old events can be deleted.

‍

The most popular implementation of the event streaming platform is Kafka Streams.

‍

Advantages

‍

  • High throughput. Event streams can handle millions of messages per second using multiple consumers to process different parts of a huge stream of events in parallel.
  • Event streams are ideal for processing real-time data.
  • Retains event history for replayability or in case of failure recovery.
  • Event streams are valuable for some of the higher-level patterns of the Event Driven Architecture, such as Event Sourcing or CQRS. But we are going to talk about them in the next part.

‍

Disadvantages

‍

  • If too many events are published too quickly, they can overwhelm consumers and cause delays. This means you need to handle backpressure properly.
  • Additional complexity. Even without taking into account infrastructure management, you have to think about stuff like handling late events, message reordering, and retries.

‍

Use cases:
Event streams fit well into large systems that have to process big amounts of real-time data quickly (fraud detection, stock markets, tracking user activity, and collecting analytics) and/or when event recovery and audit is important for the system.

‍

‍

‍

Conclusion

‍

«In this article, we’ve described how to build communication between different software components in an event-driven way. What are the pros and cons of each solution as well as in which use cases does it work well and in which it doesn’t. In the next part, we are going to talk more about architecture and how to implement some of the common event-driven patterns.»

Taras

Found this valuable? Share it forward

Related News

Newsoft at London Tech Week 2026
Events
June 10, 2026
Newsoft at FIBO 2026
Events
April 19, 2026

All news

Subscribe
to our newsletter

You've successfully subscribed
Oops! Something went wrong while submitting the form.
Stay tuned for updates and news coming soon...
PAGES
Home
Home
About us
About us
Our Cases
Our Cases
News
News
Contact
Contact
cases
MedPal AI
MedPal AI
LYMA
LYMA
Underdog
Underdog
Virgin Active
Virgin Active
Socials
Instagram
Instagram
LinkedIn
LinkedIn
Clutch
Clutch
Medium
Medium
NEWSOFT, INC 19 - 26©

We collaborate with ambitious brands and people.

Privacy Policy

Logo
All News