EDA Fundamentals in SAP Advanced Event Mesh

EDA Fundamentals in SAP Advanced Event Mesh

Event-driven architecture (EDA) stands as a design framework that steers the functionality of distributed systems by leveraging the creation, detection, response, and processing of events. Throughout this article, we're going to explore the fundamental principles of event-driven architecture as it pertains to SAP's Advanced Event Mesh. We'll embark on a journey to unravel the essential concepts necessary to grasp before diving deeper into the intricacies of SAP's sophisticated Event Mesh. Our exploratory path will cover the following essentials:

What are Events??

"Identifying the signals that dictate system interactions."

Events are occurrences that signify a change in the state of data. In the realm of information technology, events can range from a sensor detecting a shift in temperature to a user clicking a button in an application.?


Fig: Real-life examples of events

?

What is Messaging? ?

"Understanding how systems communicate."

Messaging is a method by which applications communicate data to one another through a structured system of messages. This system enables the exchange of information without requiring the applications to be directly connected or aware of each other's specific locations.

Fig: Key Participants in Messaging


In EDA, messages are directed to specific destinations that differentiate the sender (publisher) from the receiver (subscriber). Within the SAP Advanced Event Mesh, these destinations are commonly topic endpoints or queues, both of which are coordinated by event brokers.

  • Topic endpoints facilitate the delivery of messages to multiple subscribers.
  • Queues ensure messages are received by no more than one subscriber.

Fig: Eg. Event-Driven Architecture

Message Types

The SAP Integration Suite's Advanced Event Mesh handles three message varieties:

1. Event messages, which inform other applications about occurrences, often form event streams like pricing or trade sequences in financial markets.

2. Queries are messages that request data retrieval, necessitating a reply, typically via methods like HTTP GET and HEAD.

3. Commands are messages that direct an application to take action or modify its status, demanding a response and are commonly associated with HTTP POST, PUT, and DELETE methods.

Message Structure

Fig: A message has three parts: Header, Properties, and Body, as shown in the above diagram:

Message Exchange Patterns

"Examining the frameworks for message transmission."

The majority of messaging applications leverage a variety of well-established messaging exchange patterns to manage the flow of communication within a system. These patterns dictate how messages are dispatched and retrieved, each serving distinct scenarios and requirements:

  1. Publish-Subscribe: This pattern is frequently used for events. Producer publish messages to a central hub without specifying a particular consumer. The event broker then disseminates these messages to all the subscribers who have shown interest in that type of message. It's particularly effective for sending out widespread notifications, such as alerting multiple parts of a system to a user's action.

Fig: Publish-Subscribe Pattern

2. Point-to-Point: Messages in this pattern are directed to a specific queue and consumed by only one recipient. This ensures that a single consumer processes each message, which is crucial for tasks where one, and only one, process must handle the message, such as order processing or financial transactions.

Fig: Point-to-Point Pattern


2.1. Non-Exclusive Consumption:

Consumer groups can be applied to enhance the classic point-to-point messaging framework. They allow several consumers to collectively use a single queue that acts as the unique conduit for messages emanating from the producer. Even though there may be numerous consumers within the receiving application, each message is guaranteed to be delivered to just one endpoint.

Fig: Non-Exclusive Consumption


3. Request-Reply: In the request-reply messaging pattern, applications communicate bidirectionally by utilizing two distinct point-to-point channels: one channel is designated for sending requests and the other for receiving replies. This ensures that a request sent by one application is received and processed by another, which then uses the second channel to send back a corresponding response, completing the communication loop. Each message in these channels is directed to a specific recipient and handled individually, mirroring a conversation where questions are asked and answers are returned.

Fig: Request-Reply Pattern


What are Event Brokers?

"Learning about the intermediaries that facilitate event distribution."

An event broker in an event-driven architecture (EDA) is an intermediary that routes messages from producers to consumers based on subscriptions. Applications publish events to the broker, which then distributes these messages to interested clients. This broker can be a physical device, on-premise software, or a cloud-based service. It supports various exchange patterns like publish/subscribe and integrates with different systems, including SAP Integration Suite, Solace, and Kafka. By enabling an event mesh, it ensures efficient, targeted communication across diverse environments, acting as a centralized system for managing event-driven messaging.

Fig: Event Broker in Action


Understanding Topics?

"Gaining insights into the channels for event categorization."

Topics within an Event-Driven Architecture (EDA) function as a method for categorizing event messages. They resemble directories that channel similar events into specific streams. Events are associated with topics by publishers, and endpoints, or subscribers, choose topics to receive relevant events. Topics are formed as hierarchical strings that are tagged onto the event message headers.

Structure of Topics: The structure of a topic is akin to a path like a/b/c/.../n, where each segment, from 'a' to 'n', is a level in the organization's chosen classification system.

Fig: Sample Topics Structure



For instance, in a system designed to monitor weather conditions, you might see topics such as weather/region/europe for European weather updates or weather/region/asia/rainfall for rainfall information in Asia.

Subscriptions to Topics: Subscriptions are formulated using strings that may include wildcard characters to capture a broad selection of topic messages. The wildcards * and > are typically used for this purpose.

*: This symbol acts as a placeholder that can represent any value at a specific level within the topic.

For example, 
weather/region/*/rainfall could match 
weather/region/asia/rainfall as well as weather/region/europe/rainfall. - >: When this character is used at the end of a topic subscription, it signifies a match for any number of subsequent levels. 
So, weather/region/europe/> could match all types of weather events in Europe, such as 
weather/region/europe/rainfall, 
weather/region/europe/wind, and weather/region/europe/temperature/highs.         

Destinations in Topics: Upon publishing, messages are sent to the endpoints subscribed to the relevant topics. Instead of traditional addressing like physical addresses or IP addresses, the topic itself guides the message to its intended recipients. In EDA parlance, to "publish to a topic" means to send a message out to all subscribers of that topic. Topics are key to EDA's ability to facilitate targeted and efficient message distribution, aligning the delivery of information with the specific interests and requirements of the subscribers.


Message Delivery Modes

"Investigating the strategies for delivering messages."

The SAP Integration Suite with advanced event mesh supports two primary types of message delivery, each serving different use cases based on the requirements for speed and reliability:

  1. Direct Messaging
  2. Guaranteed Messaging

Direct messaging is a form of communication in event-driven systems designed for scenarios that require fast and efficient message delivery, but where it's acceptable that some messages might not be delivered in cases of congestion or failure.

Fig: Direct messaging


Here’s a concise explanation of its characteristics:

  • Immediate Subscription: Clients subscribe directly to topics, setting up a channel for receiving messages that match their subscription criteria.
  • Transient Nature: Messages aren't stored if a client is disconnected; they're only available to clients that are actively connected to the event broker.
  • Susceptibility to Loss: In situations of network congestion or system failures, messages may be dropped to maintain performance, accepting some level of message loss.
  • No Acknowledgment Required: Messages delivered to clients do not require acknowledgements, which means the sender won't be informed of successful delivery, contributing to the low-latency performance of this method. In essence, direct messaging prioritizes speed and efficiency over guaranteed delivery, making it suitable for high-throughput applications where receiving every single message is not critical.

Guaranteed messaging, or persistent messaging, is a reliable message delivery system used in applications where it's critical that no messages are lost. The main features of guaranteed messaging include:

  • Durable Subscriptions: Topic subscriptions are tied to a stable endpoint within the event broker, not directly to the transient clients. This ensures continuity and message integrity over time.
  • Message Persistence: Once the event broker confirms (acknowledges) receipt of a message, the message is considered safe and will not be lost, even in the event of system failures.
  • Message Retention: Messages are stored at a durable endpoint within the broker until a client retrieves and processes them, regardless of the client's connection status.
  • Acknowledged Delivery: When a message is successfully delivered and processed by a client, the client sends back an acknowledgement to the broker, confirming receipt.

Fig: Guaranteed messaging

In summary, guaranteed messaging is designed for scenarios where the assurance of message delivery is paramount, with mechanisms in place to store messages persistently and track their delivery to the final consumer.

Topic Endpoints and Queues

?"Delving into the infrastructure that holds and manages events."

1. Queues:

  • Multiple Topics: Can have subscriptions to several topics.
  • Consumer Flexibility: Allow one or many consumers with message distribution control.
  • Common Use: Preferred for their versatility and multi-topic support.

2. Topic Endpoints:

  • Single Topic: Limited to a subscription for one topic.
  • Simpler Use Cases: Less configurable, suitable for specific scenarios.

Fig: Queues on Event Broker

Queue Operations:

1. Message Receipt: Producers send messages to the broker's queue.

2. Storage and Delivery: Messages are stored and then delivered to consumers or held until they connect.

3. Acknowledgment: Consumers confirm processing, prompting message deletion from the queue.

Queue Durability:

1. Durable Queues:

  • Longevity: Persist independently of client connections, retaining messages for offline consumers.
  • Reliability: Ensure message delivery even after consumer disconnections.

2. Non-Durable Queues:

  • Session-Based: Exist only during the client's connection period.
  • Transient: Do not store messages post-disconnection, avoiding message build-up for unavailable clients.

Understanding Event Meshes

"Comprehending the networks that interconnect different event brokers."

1. Purpose of Event Mesh:

  • Dynamic Routing: Facilitates event distribution across various applications regardless of their deployment location.
  • Infrastructure Agnostic: Operates across different environments including on-premises, private clouds, and public clouds.
  • Scalability: Supports large-scale deployments beyond the capacity of individual event brokers.

2. Functions of an Event Mesh:

  • Reliability: Ensures secure and reliable delivery of event messages between interconnected brokers.
  • Decoupling: Allows applications to publish and subscribe to events without direct knowledge of each other.
  • Expansion: Enables growth of the system across multiple data centers.
  • Visibility: Provides the ability to trace and monitor the flow of topics within the mesh.

3. How Event Mesh Works:

  • Interconnected Brokers: Multiple event brokers connect as nodes in a mesh network.
  • Producer-Consumer Model: Applications publish events to any broker and subscribers receive them through the mesh.
  • Geographic Distribution: Facilitates event communication among applications located in different regions.

4. Illustrative Scenario:

Fig: Sample Event Mesh Scenario



  • Separate Brokers: Without a mesh, Consumers on Europe only receives events from Europe on the Europe event broker, missing events from Producer on a different broker.
  • Event Mesh Configuration: With an event mesh, Consumers from India connects to India event broker but receives events from both Producer from Africa and Producer from Australia, regardless of their broker connections.

In summary, an event mesh extends the capabilities of individual event brokers to create a robust, scalable, and flexible backbone for an enterprise's event-driven architecture, ensuring seamless event communication across disparate systems and locations.

Dynamic Message Routing

"Discovering how messages dynamically navigate to their destinations."

Dynamic Message Routing (DMR) Overview: DMR is a key feature in event-driven architectures (EDAs) that enhances the delivery and management of messages across different event brokers, which are also known as nodes, within an event mesh. Here's a breakdown of how DMR functions in both horizontal and multi-site scaling:

Horizontal Scaling with DMR:


Fig: Horizontal Scaling


Cluster Formation: Brokers are interconnected to form a DMR cluster, often within the same physical location or data center.

Internal Links: Nodes within a cluster are fully connected via internal links, creating a "full mesh" where every node can communicate with every other node directly.

Seamless Routing: Events published to one node are distributed to all relevant nodes within the cluster without any special configuration required from the client applications.

Multi-Site Scaling with DMR:

Fig: Multi-Site Scaling


Cluster Linking: Multiple DMR clusters are connected through external links to enable communication between different sites or data centers.

Gateway Nodes: In clusters with multiple nodes, a designated gateway node manages the communication between clusters.

Selective Connection: Not all clusters need to be directly connected to one another; messages are only propagated between clusters that have established external links.

Operational Flexibility of DMR:

Dynamic Discovery: Once set up by an administrator, brokers within the mesh dynamically identify the best routes for message delivery.

No Client Changes: Applications publishing or subscribing to messages require no changes to interact across the mesh; the DMR handles all routing complexities.

Auto-Adjusting Mesh: The event mesh automatically adjusts to changes in application locations or subscription interests, ensuring consistent message flow without manual intervention.

Routing Limitations:

Direct Connectivity: Messages are only routed between clusters that have direct external links. For instance, if Cluster B and Cluster C are not directly connected, they cannot exchange messages.

In summary, DMR enables an efficient, flexible, and scalable messaging infrastructure, allowing applications to communicate across an interconnected network of event brokers without the need for individual applications to manage the complexities of message routing.


Conclusion

Event-driven architecture (EDA) is an essential design paradigm that capitalizes on the production, detection, consumption, and reaction to events. This article has provided a comprehensive exploration of the EDA framework, particularly focusing on SAP's Advanced Event Mesh, which is pivotal for orchestrating distributed systems' responsiveness and agility. We commenced our journey with the basics—defining events as signals that trigger system interactions and messaging as the conduit for data exchange between applications in a decoupled fashion. Topics and queues serve as the underlying infrastructures, managing the categorization and delivery of messages, while dynamic message routing (DMR) operates as the intelligent navigation system, ensuring messages reach their destinations across the mesh. The SAP Integration Suite's Advanced Event Mesh stands out as a sophisticated tool that manages the complexities of EDA by facilitating various message exchange patterns—publish-subscribe, point-to-point, and request-reply—each tailored to specific communication requirements. With these patterns, the Advanced Event Mesh guarantees both the broad dissemination and targeted delivery of messages, providing the flexibility and reliability needed in modern IT landscapes. Furthermore, the article shed light on the operational mechanics of event brokers, which act as the central hubs in an EDA, channeling messages between producers and consumers. Through the lens of the SAP Advanced Event Mesh, we've seen how topics organize events, subscriptions define consumer interests, and message delivery modes determine the reliability and speed of communication. At the heart of EDA lies the event mesh, a dynamic and scalable network that interlinks various event brokers, ensuring seamless event communication, regardless of geographical or infrastructural barriers. The introduction of DMR within the event mesh signifies a leap in messaging intelligence, allowing for a self-regulating system that adapts to application movements and evolving interests without human intervention. In closing, SAP's Advanced Event Mesh and the principles of EDA represent a robust framework that gears today's distributed systems towards a more integrated, responsive, and efficient future. This powerful combination of technology ensures that as the complexity of IT environments grows, the flow of information remains seamless, scalable, and synchronized with the ever-changing demands of the business landscape.



Disclaimer: The information in this article is provided for general informational purposes only and does not constitute professional advice. While efforts are made to keep the information up-to-date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the article or the information, products, services, or related graphics contained in the article for any purpose. Any reliance you place on such information is therefore strictly at your own risk. We are not affiliated with SAP or any other companies mentioned in the article. References to specific technologies, products, or services are for informational purposes only. All trademarks, service marks, and logos mentioned belong to their respective owners. Use of these names, trademarks, and brands does not imply endorsement.


Praveen M.

?I help Businesses Upskill their Employees in SAP Finance | Expert SAP Corporate Trainer & Finance Process Architect

7 个月

Delving into the depths of Event-Driven Architecture with SAP's Advanced Event Mesh. Your expertise shines through in unpacking the essentials of EDA. The insights shared are invaluable for professionals across the spectrum.

Dinesh Adala

Integration Architect | SAP PI/PO/CPI | SAP BTP Integration Suite - Certified

7 个月

A handbook precisely illustrated on Event-Driven Architecture (EDA).

Amit Kumar

Engineering Manager at Booking.com

7 个月

A clear and well-structured explanation of event-based architecture, making it easy for SAP emthusiasts to understand the concepts involved. Thanks for sharing.

Wouter van Heddeghem

Senior SAP S/4HANA Finance Consultant + Dutch + French + Spanish + English. 707,000 SAP Followers. I promote SAP jobseekers for free on LinkedIn.

7 个月

#solace

回复
???? Dani Macho

Lead Enterprise Architect for Integration at IT APS - Siemens Corporate IT, ex-NESTLE, ex-Xerox, ex-Aspentech

7 个月

Michael Bauer Moritz Heimpel interesting article about SAP AEM to enable EDA. Especially important hierarchical structure of topic taxonomy and capabilities to create Event Mesh among others. More info: https://solace.com/differences/kafka/solace-kafka-comparison-summary/

要查看或添加评论,请登录

社区洞察