Anatomy of a CloudEvents and its relevance with SAP and Google Cloud

ameyasapcloud_0-1700803713387.png

CloudEvents is an open specification for describing event data in a common way. It provides a standardized format for capturing event information, including the event type, source, and timestamp, as well as any additional event-specific data. This common format makes it easier for different systems and platforms to exchange events and for developers to build event-driven applications. The specification is currently under CNCF.

Here are some of the key benefits of using CloudEvents:

  • Interoperability: CloudEvents makes it possible for different systems and platforms to exchange events without the need for custom translation or conversion. This can help to reduce development costs and improve the overall performance of event-driven applications.
  • Portability: CloudEvents are not tied to any specific cloud provider or platform. This means that applications that use CloudEvents can be easily migrated between different environments.
  • Simplicity: The CloudEvents specification is relatively simple and easy to understand. This makes it easy for developers to get started with CloudEvents and to build event-driven applications.

CloudEvents is supported by a number of major cloud providers, including Google Cloud.

CloudEvents Attributes

CloudEvents are defined by a set of attributes that provide context and information about the event. These attributes are categorized into three types:

ameyasapcloud_1-1700803750237.png

Mandatory Attributes: These attributes must be present in every CloudEvent. They provide essential information about the event and its origin.

Context Attributes: These attributes provide additional context about the event and its environment. They are optional, but they can be useful for understanding the event and its implications.

Extension Attributes: These attributes are defined by specific extensions or protocols and provide additional information relevant to those extensions or protocols. They are optional and may vary depending on the specific extension or protocol.

In summary, CloudEvents provides a standardized and interoperable format for representing events, enabling consistent handling and interpretation across different systems and applications. The mandatory attributes provide essential information about the event, while context and extension attributes can enhance understanding and integration with specific extensions or protocols.

CloudEvents Formats

There are 2 types of formats for CloudEvents:

Binary Encoding:

A “binary-mode message” is one where the event data is stored in the message body, and event attributes are stored as part of message metadata.

Binary mode is used when the producer of the CloudEvents wishes to add the CloudEvents metadata to an existing event without impacting the message’s body. This is good for receivers unaware of CloudEvents, as the metadata can be ignored.

Example:

ameyasapcloud_2-1700803794194.png

Structured Encoding:

A “structured-mode message” is one where the entire event (attributes and data) are encoded in the message body, according to a specific event format.

Allows simple forwarding of the event across multiple routing hops as message metadata need not be filled.

Example:

ameyasapcloud_3-1700803823501.png

CloudEvents with SAP

CloudEvents are a key component of SAP S/4HANA Cloud’s extensibility capabilities, enabling real-time communication and event-driven integration between S/4HANA Cloud and other systems or applications.

Here are some examples of how CloudEvents can be used in SAP Ecosystem:

  • Event-frameworks: SAP developed event-frameworks for different line-of-business solutions and has published a very impressive set of event objects that became available for S/4HANA (Cloud and On-Premise). You can find them documented on the API business hub. Events are sent following the CloudEvents specification.
  • SAP Kyma Eventing: is a component of SAP BTP Kyma runtime that enables event-driven communication between microservices and serverless functions within the Kyma runtime, as well as between the Kyma runtime and external systems. It adheres to CloudEvents specification and provides options to process events using CloudEvents SDK.
  • SAP Event Mesh: Supported the use of REST APIs for publishing and consuming events that are compliant with the CloudEvents specification its standard event format. This means that events published to SAP Event Mesh must adhere to the CloudEvents specification.

CloudEvents in Google Cloud Services

CloudEvents are widely used across Google Cloud services to facilitate event-driven communication and data exchange between applications, services, and platforms. Several Google Cloud services issue CloudEvents, please refer here for the exhaustive list of Google Issued Events. Here’s a concise overview of how CloudEvents are employed in various Google Cloud services:

  • Google Cloud Pub/Sub: CloudEvents serve as the default format for events published and consumed through Cloud Pub/Sub, a real-time eventing service. This enables decoupled applications and services to exchange event notifications in a standardized and interoperable manner.
  • Google Cloud Functions: CloudEvents are natively supported as input triggers for Cloud Functions, a serverless compute platform. Functions can be triggered based on incoming CloudEvents, allowing for event-driven execution of application logic.
  • Google Cloud Storage: CloudEvents are triggered for the various lifecycle activities for files stored in Google Cloud Storage. This provides a simplified mechanism for capturing events and enabling downstream processes on the files.
  • Google Cloud Audit logs: Audit logs can be transformed into CloudEvents, providing a standardized and interoperable format for representing and consuming audit log data.
  • Google Cloud Vertex AI Platform: CloudEvents can be integrated with Vertex AI Pipelines, to facilitate event-driven data ingestion and model training for machine learning applications.
  • Google BigQuery: CloudEvents are triggered for various events from services like BigQuery, BigQuery BI Engine, BigQuery Data Transfer etc. With this you can achieve functionalities like running an ELT job whenever a new table partition is created, or maybe you want to retrain your ML model whenever new rows are inserted into the table.
  • Google Cloud APIs: CloudEvents are increasingly being incorporated into Google Cloud APIs, providing a consistent and standardized way for applications to interact with Google Cloud services and receive event notifications.

Google Cloud Eventarc

Google Cloud Eventarc is a fully managed eventing service that simplifies the process of connecting applications, services, and systems using event-driven architectures.

ameyasapcloud_4-1700803893065.png

CloudEvents play a central role in Google Cloud Eventarc, an event routing service. Eventarc can receive CloudEvents from various sources, including Cloud Pub/Sub, Cloud Storage, and external systems, and route them to appropriate destinations, such as Cloud Functions or HTTP endpoints. Here is the “exhaustive” list of event types supported by Eventarc.

In summary, CloudEvents have become an integral part of the Google Cloud ecosystem, enabling event-driven architectures, facilitating interoperable data exchange, and empowering developers to build scalable and responsive applications.

Conclusion

In conclusion, CloudEvents are a powerful tool for enabling event-driven communication between systems and applications. They are supported by a wide range of Google Cloud services and are also used in SAP S/4HANA Cloud. By leveraging CloudEvents, you can build scalable, resilient, and event-driven applications that can react to changes in real time.

Harnessing the power of CloudEvents paves the way for a myriad of innovative use cases designed to tackle complex business challenges. In the upcoming articles, we will delve into the intricacies of how ABAP SDK for Google Cloud seamlessly integrates with CloudEvents, enabling you to realize the full potential of event-driven architecture and transform your business operations. Stay tuned for this exciting journey!

Join the community today !!!!

The ABAP SDK for Google Cloud Community is now open! This is a place for you to ask questions, share knowledge, and collaborate with other ABAP developers who are using Google Cloud. We encourage you to get involved in the community and help us make the ABAP SDK for Google Cloud even better. We have a lot of exciting things planned for the future, and we want you to be a part of it.

Click the link to join and innovate with us.

Subscribe to the youtube channel where you would find, a quick 5 minutes overview covering the design principles and capabilities of ABAP SDK, reference architectures and art of the possible SAP solutions based on Google’s AI services, Google Workspace APIs and Google Maps Platform APIs…. along many more insightful references.

Follow this medium tag for more content on ABAP SDK for Google Cloud.

Happy Learning! and Happy Innovating!

 
Version history
Last update:
‎11-23-2023 10:18 PM
Updated by: