Explaining Event-Driven Architecture

Objectives

After completing this lesson, you will be able to:

  • Explain what an event-driven architecture is
  • Define components of an event-driven architectures
  • Articulate event types and event formats
  • Explain two main patterns for transmitting events
  • Describe the benefits of an event-driven architecture

Event-Driven Architecture

Almost every event in a business is time sensitive. When a customer makes an online purchase, a sensor flags an impending malfunction, a stock price drops, or a security breach is detected – immediate action needs to be taken. This is where an event-driven architecture (EDA) comes in. An EDA can create, detect, and respond to events as they unfold, helping businesses improve everything from customer experiences to operational efficiency and agility.

Therefore, an event-driven architecture is an integration model built to publish, capture, process, and respond to events across distributed systems in real time. When an event occurs in one application, a message is automatically sent to all the other applications that need to know about it, so they can act on it in turn.

Event-based architectures are decoupled – meaning applications don’t need to be aware of each other to share information and complete tasks. Event information, or messages, can flow freely and automatically between apps. As a result, the EDA model is much faster than the traditional request/response model, where one application must request the specific information, it needs from another and wait for a response before moving on to the next task. Also,due to the decoupled nature of an EDA, they are widely considered best practice for microservice communication

In an event-driven architecture, applications act as event producers (apps that produce or capture events) or event consumers (apps that process and act on events). Producers transmit events to consumers via a broker, aka messaging-oriented middleware, in real time. Consumers can then process the event and trigger other actions, workflows, or events of their own.

In a very simple architecture – when there is a single producer and a single consumer that are in direct communication with each other – brokers can be optional. However, in most enterprises there are multiple sources sending out events to multiple consumers, so a broker, or even a network of brokers (also known as an "event mesh") is needed. When a broker or an event mesh is used, this creates a "loose coupling" of applications.

At SAP, a set of standard events is implemented in the business applications, in particular SAP S/4HANA and catalog those events, based on an open standard, CloudEvents. Based on that standard, automation and development tools can consume those events, or third-party systems can be connected.

Components of an Event-Driven Architecture

Let’s take a deeper look at some definitions that are important to know and understand when it comes to event-driven architectures:

  • Events are significant changes in state. In the SAP world this could be a Business Partner getting updated in SAP S/4HANA or a SalesOrder created in SAP ECC.
  • Event Sources are the source of the event and broadcast the event to indicate that it has occurred. Event Sources only know about the occurrence of the event; they don’t know who is interested in the event and what the interested parties will do in reaction to being informed about the event. In the SAP ecosystem the most common event sources are the different back-end systems like SAP S/4HANA or SAP SuccessFactors solutions.
  • Event Brokers are intermediaries that broker and manage events. SAP Event Mesh and SAP Integration Suite, advanced event mesh are SAP's event brokers.
  • Event Consumers are software components that subscribe to the event broker to be informed about events. In the SAP ecosystem, several kinds of event consumers are possible, ranging from extension applications on SAP Business Technology Platform to full blown SAP back-ends like SAP S/4HANA.

Event Types and Formats

There are in the end two main event types, notification events and data events, plus a hybrid event type that can be called decision event.

Notification Events

Notification events are typically as small as possible and contain only the absolutely required information. The idea behind this type of event is that consumers are informed of a change and can then decide whether they care about this change or not. If the change isn’t relevant for the consumer, the consumer ignores the event completely. If the change is relevant for the consumer, the consumer will follow up by requesting additional data and executing on this data.

Notification events have a number of advantages and have certain disadvantages as well:

  • They are typically very small so a lot of notifications can be sent.
  • They contain only the absolutely required data so data access can be controlled in a better way.
  • An additional step is needed when following up on an event to access all required data.
  • Depending on the number of events that are followed up on, they can be highly efficient or highly inefficient.
Data events

Data events already contain all data in respect to the event that might be relevant for the consumer. No additional request is needed; event processing can start immediately. Data events are bigger than notification events and can potentially be really big. The result is that the costs in respect to transportation of these events from a resource perspective are higher. Advantages/disadvantages of data events are as follows:

  • All potentially needed data is included in the event; no additional request is needed.
  • Serve well for use cases in which the consumer would require a full data set in the majority of cases.
  • Data events tend to be big, resulting in higher resource consumption and, in the end, in higher costs for the event broker.
  • There is a certain loss of control in respect to who can access potentially sensitive data.
Decision Events

Decision events are in the end notification events that contain more data. The idea is that more data in the events results in a better basis to decide on the relevance of the event, and therefore a smaller number of API calls or better informed API calls.

CloudEvents Format

SAP Events are typically exposed in a standard way following the CloudEvents format, with a well-defined hierarchy and metadata that can easily be consumed on different platforms. CloudEvents is a specification for describing event data in a common way jointly driven by the Cloud Native Computing Foundation (CNCF) and a number of software companies, including SAP.

Event-Driven Architecture Patterns

There are two main patterns for transmitting events in an event-driven architecture: publish/subscribe and event streaming.

  • Publish/subscribe (aka "pub/sub") – With pub/sub, event consumers subscribe to messages and channels published by event producers. When an event is published, it is sent directly to all subscribers via a broker. To avoid duplication, events cannot be replayed or accessed once consumed – they are deleted by the broker.
  • Event streaming – With event streaming, producers publish entire streams of events to a broker. Consumers subscribe to the stream and can read from any part it, consuming only the events that are relevant to them. With this pattern, events are retained by the broker even after they are consumed.

Benefits of an Event-Driven Architecture

Therefore, some key benefits of an event-driven architecture can be summarized, for both, technology-wise and business-wise.

The figure lists the benefits of an event-driven architecture separated for technology and business.

An event-driven architecture brings an array of technological benefits propelling businesses towards next-gen computing styles. One of the fascinating advantages is the loose coupling which offers flexibility and scalability. By structuring and managing services to act independently, EDA provides a flexible infrastructure that can easily scale up or down in response to business needs.

Another major benefit is the improved fault tolerance rendered by suitable patterns. EDA promotes robustness and resilience, significantly reducing the chances of overall system failure. In case any single component fails, it does not affect the other independent components, ensuring uninterrupted and efficient operations.

The EDA framework also supports incremental growth and accumulation of higher-quality operations - realizing this through the step-by-step addition of event consumers and event sources. It allows businesses to grow iteratively, introducing new capabilities gradually without disrupting existing operations. This also ensures that the quality of operations is maintained, if not enhanced, with each additional element.

Moreover, EDA facilitates real-time technical integrations and extensions. Using events as a common communication bridge, it seamlessly binds numerous services and applications, fostering fast and efficient collaboration. This leads to improvements in productivity and speeds up innovation, enabling organizations to respond swiftly to market changes.

In summary, the strategic application of an event-driven architecture can dramatically improve operational resilience, flexibility, and adaptability, making it an attractive approach for businesses in the era of digital transformation.

An event-driven architecture also offers several strategic business advantages, paramount among them being it facilitates improved reaction time and significantly reduces costs. These benefits primarily stem from the full automation of real-time business processes that an event-driven architecture allows. This leads to heightened efficiency and a faster decision-making process, giving businesses an upper hand in today's rapidly evolving market environment.

Furthermore, this architecture lays the framework for more intelligent business decisions. It delivers the most recent data and up-to-date information, critical for strategic planning and forward-thinking business initiatives. This not only allows businesses to stay ahead of the curve but also makes them more agile in response to evolving market dynamics and customer demands.

Beyond the internal benefits, an event-driven architecture also supports an open ecosystem that extends across vendor boundaries. In this inter-connected landscape, businesses can foster better relationships with third party vendors, encouraging effective collaborations and seamless interactions. This level of cohesiveness can enhance overall business performance and customer satisfaction.

Another distinctive business benefit of an event-driven architecture is its ability to empower organizations through a social media-like communication style. This ensures everyone involved in the process, from top-level management to the employees on the ground, are always informed and aligned — a vital aspect for maintaining operational transparency and achieving common business goals. In effect, an event-driven architecture serves as a catalyst to promote comprehensive and accelerated growth, making it a strategic choice for businesses looking to dominate in their respective sectors.

Realizing an Event-Driven Architecture With SAP Integration Suite, Advanced Event Mesh

SAP Integration Suite, advanced event mesh is a comprehensive platform that includes event streaming, event management, and event monitoring for an event-driven architecture (EDA). Offered as a software-as-a-service (SaaS), it allows organizations to accelerate EDA adoption and fulfill modern use cases. The platform includes services such as event streaming through Mission Control, event management through Event Portal, and event monitoring and insights through Insights. It also offers deployment options and a REST API for administrative tasks, along with a variety of rich client APIs for connecting to event broker services. These subscription services are accessible through the Cloud Console, allowing for the management of Advanced event mesh accounts.

SAP Integration Suite, advanced event mesh will be explained in more detail throughout this learning journey.

Summing Up

An event-driven architecture (EDA) is an integration model that publishes, captures, processes, and responds to events across distributed systems in real time. It enables applications to send and receive messages automatically when an event occurs, without needing to know about each other, making it faster than the traditional request/response model. In EDA, applications can either be event producers or consumers, transmitting events via brokers or an event mesh. Although brokers can be optional in simple, single-consumer and single-producer setups, they are essential in lager enterprise scenarios for efficient communication between multiple applications.

Thus, the architecture consists of event sources, event brokers, and event consumers, with different types of events such as notification events and data events. The benefits of EDA, both technology-wise and business-wise, include loose coupling, improved fault tolerance, smarter business-decisions, and open ecosystem across vendor boundaries, to name a few.

SAP Integration Suite offers an advanced event mesh platform for event-driven architecture, which includes event streaming, management, and monitoring services, and is accessible through the Cloud Console.

Log in to track your progress & complete quizzes