Different systems consuming events from a bus

Event-driven architectures

In this post, we will look at how event-driven architectures can help you. This article is based on our experience working with multinational companies that serve hundreds of thousands of potential customers at once, creating millions of events every day.

Introduction: What is an event?

The first thing is to define the basics. An event is a relevant occurrence in a system or business that can be leveraged by other systems to act automatically.
Examples:

  • In a store, when a customer pays, a "purchase made" event or multiple " inventory modification" events occur .
  • At a bank, a cash withdrawal is an event.
  • In logistics, when a package changes status, for example when a delivery person picks up the package and puts it in the van, an event occurs.

Key concepts

  • Producer: The person who generates the event and publishes it in an intermediate system. Example: When the delivery person scans a package with their phone and puts it in the van, they generate the event "goods in delivery."
  • Consumer: This is the entity that listens to or receives the event and performs an action in response. Continuing with the previous example, a notification system at our logistics company receives the previous event and notifies the customer by email that their package is being delivered.

Benefits compared to a traditional approach

In a classic model, tasks are executed sequentially. If one is delayed or fails, the entire process slows down.

With event-driven architecture:

  • Parallelism: several systems react simultaneously to the same event.
  • Less coupling: the producer does not need to know the consumers.
  • Independent scalability: each component grows according to its load.
  • Resilience: if one consumer fails, the others continue to function.
  • Extensibility: new consumers are added without affecting the producer.

How to integrate event architecture with legacy systems

One of the great benefits of working with events is that you can modernize an old system without touching its core code.

If you can get that legacy system to publish events when it performs certain operations, any modern system can subscribe to them and add new functionality:

  • Mobile notifications.
  • Cloud dashboards.
  • Process automation.
Legacy systems communicating with new systems through events

This allows for innovation without having to start from scratch, without depending on the original language or technology of the system, reducing risks and accelerating modernization.

What is Kafka?

Apache Kafka is a distributed, open-source platform for real-time event handling.


It was created by LinkedIn and is now maintained by the Apache community and companies such as Confluent.

  • License: free and open source.
  • How it works:
  • Producers publish events in topics.
  • Kafka stores these events in an orderly and durable manner.
  • Consumers subscribe to these topics and process the information.
  • Why is it so popular?:
    • High performance and low latency, capable of handling millions of events per second.
    • Large community and support: it is easier to find solutions and documentation.
    • Scalable and reliable for large volumes.
    • Ideal for extending existing systems and connecting multiple applications.

When to use event-driven architecture (and Kafka)

Ideal cases:

  • Critical real-time information (bank balance, shipping status, security alerts).
  • Need to parallelize actions and improve performance.
  • Scenarios for scalability and resilience.

When it is not the best option:

  • Processes where immediacy is not important (analytical reports that are updated every 30 minutes or once a day).
  • When the added complexity of events does not provide significant value compared to a batch process.

Kafka Streams vs. regular Kafka

Although Kafka Streams offers advanced features (joins, stateful processing), our experience has been that:

  • Documentation and examples are less abundant.
  • The learning curve is steeper.
  • Normal Kafka is more stable and easier to operate in high-load environments.

That's why, in many cases, we prefer basic Kafka to maintain simplicity and reliability.

Conclusion

Event-driven architectures not only improve performance and resilience, but also open the door to modernizing legacy systems without rewriting them.

About the author:


Alberto Barranco is the founder and CEO of Osohub. He has been developing since 2010.

At Osohub, we create high-quality software using our experience, continuous learning, and Artificial Intelligence.
We develop custom software for large national and international companies.

Do you have something in mind? Let's talk.

At Osohub, we don't just write code, we speak the same language as our clients.

We design solutions with an understanding of the business behind them, whether it's logistics, aviation, finance, or sales.

Because that's the only way to build software that really works.

Write to us at hola@osohub.com