Event Driven Architecture

Event Driven Architecture Definition

Event-driven architecture is a modern application design pattern that is based on principles of loose-coupling and message-driven interaction. While event driven architectures were first proposed in the early 2000s, they have recently seen broad adoption across IT organizations in diverse industries. This adoption has been driven by the need for high-performance processing that spans extremely large real-time datasets. An increasingly common form of event-driven architecture is streaming architecture, built around technologies such as Apache Kafka or Apache Pulsar.

Event-driven architecture publishes events that applications and services can consume, using those events to perform actions. In contrast, event-streaming services, such as Kafka and Pulsar, publish streams of events to a broker. The broker serves as an intermediary for event- consuming applications, which can flexibly access streams as needed. Unlike event-driven architecture, the events are persisted by the broker. By persisting events, event streaming platforms enable applications to process both historical and real-time data.

Diagram depicting events moving from event producers through event channel and distribted to event consumers.

Event Driven Architecture FAQs

What is an Event?

An event is any change in state for system hardware or software. Events can originate from end users interacting with a Web UI, from sensors monitoring vehicles and machinery, as well as from system components generating monitoring metrics. For example, a new set of GPS coordinates for a moving vehicle is an event; an updated torque reading for a manufacturing robot is an event; a user clicking on an ad. All of these are events. In short, any change of state within a system can be considered an event.

Events have become the lifeblood of digital businesses. For example, the ride hailing service Grab relies on events to track vehicle and rider locations in real-time. This telemetry is continuously transmitted, received, and processed as discrete events. Similarly, event driven architecture is commonly used to monitor distributed systems, in which heterogeneous components generate vast quantities of metric-based data. Similar event-driven models are increasingly used across most organizations, regardless of vertical industry. Notably, leading technologies for event-driven architecture are architected to support trillions of events per day.

How does Event Driven Architecture Work?

Event-driven architecture involves event producers (also called emitters or agents), event consumers (also called sinks), and event channels (also called brokers). Producers detect events and pass them along for processing by the event channel. The decoupled architecture means that producers are insulated from the details of the consumers or sinks; it needs no knowledge of whether any consumers even exist. Consumers can be added and removed dynamically, without impacting the overall system. Such decoupling enables event driven systems to evolve along with shifting requirements.

Sinks are responsible for transforming events as needed, whether that means independently responding to the event, or filtering and forwarding it to another component. Events are transmitted from producers to consumers through event channels. The distribution of events is determined by the event channel. Event channels are often based on message-oriented middleware.

What Are the Benefits of Event Driven Architecture?

Implementing event-driven architecture can boost scalability and responsiveness of applications, improving user experience, driving more informed business decisions, and providing competitive advantage. Event-driven architecture enables flexible systems that adapt to changes, enabling business agility through real-time decision-making. Combined with artificial intelligence (AI) and machine learning (ML), event driven architecture is a key enabling technology of the intelligent real-time enterprise.

How Is Event Driven Architecture Used in Web Applications?

Modern high-performance web applications rely on a responsive user interface (UI) layer that interacts, typically via Web APIs, with the microservices that implement business logic. Those microservices access data stores and other resources to respond to events and process messages. The communication between the web application UI and the microservices can consist of synchronous API calls; the UI doesn’t respond until the API call has returned. Event-driven architecture can further decouple the UI from the business layer by relying on a message bus to enable asynchronous communication.

How Is Event Driven Architecture Used for Streaming Data?

There are two main kinds of event-driven architectures: message queues and stream processing. Of the two, streaming is the more asynchronous and decoupled model.

Data streaming is a processing model supported by event driven architectures. Unlike traditional message queues, data streaming completely decouples event products from event consumers. The result is a fully asynchronous messaging infrastructure that permits great flexibility and responsiveness. It also prevents performance bottlenecks that might occur in more tightly-coupled systems.

Stream processing has emerged as the leading choice for most event-driven systems. The primary benefit over message queues is the dramatic increase in flexibility, as streaming supports multiple consumers, event replay, and sliding window statistics.

What Are Good Event Driven Architecture Tools?

The most popular event processing processing platform today is Apache Kafka, a distributed data streaming platform. Apache Kafka is a distributed streaming platform that supports a topic-based producer-consumer communication pattern that combines benefits of both message queues and publish-subscriber patterns. Kafka supports real-time publishing, subscribing, storing, and processing of event streams, and is generally used for applications that require high throughput and scalability. A key benefit of Kafka is the elimination of point-to-point integrations for data sharing in certain applications.

In discussions of event-driven architecture Kafka is often mentioned first, as a well-known implementation of the architecture. Apache Kafka is an open-source publish/subscribe messaging system that has become the event streaming architecture of choice for many companies.

What’s the Difference Between Event Driven Architecture vs. Microservices?

Many legacy applications were implemented as a single monolithic application, which often created issues with scalability. If one function had a bottleneck, that individual feature could not scale out independently to improve performance. Microservices address this limitation by decomposing monolithic applications into functional components, each of which can scale independently. Such decoupling makes microservices a natural fit for event-driven architecture.

How to Choose a Database for Event Driven Architecture

As noted, Apache Kafka is architected to support trillions of events per day with real-time responsiveness. Very few databases available today are capable of supporting these requirements. Traditional relational database management systems (RDBMS) are simply built for a different application paradigm. NoSQL databases, which offer high availability and scale-out capabilities are better suited for event driven architectures. However, even within the expansive family of NoSQL databases, only very few are capable of supporting the extreme requirements imposed by event driven architecture. The overall performance of event driven data architecture is often bottlenecked by the performance of the underlying data storage layer.

Is ScyllaDB Suitable for Event Driven Architecture?

As the real-time big data NoSQL database, ScyllaDB is an ideal backend for event-driven architecture. Today, ScyllaDB is in production use at many leading companies across industries such as communications, Internet of things (IoT), AdTech, and transportation, which rely heavily on event-driven architecture and stream processing. ScyllaDB’s shared-nothing and shard-per-core architecture provide predictable low-latency even across distributed datasets of billions of points. Combined with industry-leading support for Apache Kafka, these capabilities make ScyllaDB the go-to storage layer for event driven architecture.

Trending NoSQL Resources

ScyllaDB University Mascot

ScyllaDB University

Get started on your path to becoming a ScyllaDB expert.