Skip to main content

CloudEvents

A specification for describing event data in a common way

cloudevents

What is CloudEvents

CloudEvents is a specification for describing event data in a common way. CloudEvents seeks to dramatically simplify event declaration and delivery across services, platforms, and beyond

This is useful in many scenarios, for example, routing events to the appropriate subscribers depending on the type of the event. Since applications can use a lot of different transports to send and receive events, the CloudEvents spec is protocol-agnostic so it defines protocol bindings in order for the metadata to be correctly mapped for HTTP, AMQP, Kafka, etc.

Why Cloudevents

Consistency

The lack of a common way of describing events means developers have to write new event handling logic for each event source.

Accessibility

No common event format means no common libraries, tooling, and infrastructure for delivering event data across environments. CloudEvents provides SDKs for Go, JavaScript, Java, C#, Ruby, PHP, PowerShell, Rust, and Python that can be used to build event routers, tracing systems, and other tools.

Portability

The portability and productivity we can achieve from event data is hindered overall.

Cloudevents uses

There are many use cases in using the CloudEvents spec, but perhaps the main one would be interoperability. Imagine applications across clouds, being able to communicate in an event-driven architecture. Where there are producers of all sources, and consumers using all kinds of protocols (e.g. HTTP, AMQP, WebSockets). We can have middleware that connects these applications, adds E2E tracing and more with the use of CloudEvents

Another use case is SaaS (Software-as-a-service) that publishes events that clients are interested in to integrate with their own systems. For example, hooking into the checkout flow in a Shopify storefront to add extra checks.

Relation with Serverless computing

Serverless computing has increased in popularity and use in the industry, especially for it’s cost model. But many FaaS (Functions-as-a-service) providers have their own function interface. Which means developers can’t write a function in JavaScript, and deploy them in two cloud providers without making changes. This specification improves portability between FaaS platforms, so that developers receive an event in the same format and can reuse libraries for handling the event.