Simplify your Event Streaming Solution Using AWS Partner Event Bus with Amazon EventBridge

AWS IaC

Software-as-a-Service (SaaS) is the future of enterprise computing. By integrating SaaS offerings into their tech stacks, companies can take full advantage of cloud computing to reduce their operational expenses, scale more easily, enhance agility, and respond faster to new opportunities. Whether it’s for HR management, customer relationship management (CRM), enterprise resource planning (ERP), performance management, or something else, SaaS is here to stay.

All these SaaS products are significantly different from each other in terms of their tech stack, service offerings, and integrations. Nonetheless, there are many patterns and components that almost all of them have in common. One such common pattern is the use of event-driven architecture.

Event-driven architecture (EDA) uses events to trigger and communicate between decoupled services in modern SaaS applications. One of the easiest ways to build event-driven applications is to use a serverless event bus with a service like Amazon EventBridge.

This brief article explores Amazon EventBridge and explains how SaaS providers use the service to enable event streaming for their SaaS applications.

What is an Event-driven Architecture?

Event-driven architecture (EDA) is a development model in which cloud-based microservices react to some changes in state, known as events. Various events trigger microservices that work together towards a common goal even as they apply their own business logic and create their own output events.An EDA consists of three key elements:•       Event producers who generate events and publish them to event routers•       Event routers (brokers) who ingest and filter events and push them to consumers•       Event consumers (sinks) who receive the eventsThe producer and consumer services are “decoupled” to allow for independent scaling, updates, and deployments. They communicate on event triggers.An EDA eliminates the need to write custom code to poll, filter, and route events, thus increasing development speed and agility. It also simplifies application audits and policy definitions and consumes less network bandwidth and CPU.Unfortunately, it’s not simple to handle outbound events in SaaS applications. A serverless event bus can reduce the complexity and enable developers to build event-driven applications at scale.

Challenges of Handling Outbound Events in SaaS Applications

SaaS providers generate millions of events by capturing the actions of thousands of tenants from a single hosted solution. Tenants usually expect to receive their business-specific filtered events for further processing or to perform custom actions. It’s not feasible to establish and maintain point-to-point connections every time to meet this demand for event streaming.As a workaround, SaaS providers require an easy-to-manage, robust solution that enables easy connections between applications. The solution should deliver a stream of real-time data from multiple event sources and decouple the event publisher and consumer. Here’s where Amazon EventBridge comes in.

What is Amazon EventBridge?

Amazon Web Services (AWS) offers numerous cloud-native services to publish and consume events and build event-driven applications for EDAs at scale. One such service is Amazon EventBridge. With EventBridge, events can flow across the various services in an AWS account with a few clicks and easy configurations.EventBridge simplifies the process of building event-driven applications that subscribe to events from any participating SaaS product. This serverless event bus ingests data from supported SaaS applications and routes it to AWS services and SaaS targets. There’s no need to write custom integration code to deliver events or to add schemas from the event bus to the registry. EventBridge also removes the need to provision/patch/manage servers and install/maintain/operate additional software.SaaS providers can enhance and extend their SaaS platform by publishing events to EventBridge. They get a set of APIs to easily inject events for their customers' applications to process inside AWS. They can also manage the routing of those events to their customers reliably and securely. Leading SaaS providers like Salesforce, Zendesk, Datadog, Okta, New Relic etc., have already listed their event sources on AWS.Their customers can enable EventBridge in their account and start receiving and processing events with just a few clicks. They can also use EventBridge to:•       Connect their SaaS apps•       Integrate their own AWS applications with microservices, SaaS applications, and custom applications•       Use events from SaaS apps to trigger various workflows•       Send events to other AWS services like AWS LambdaNeedless to say, one critical prerequisite is that the tenant/customer must have an AWS account to receive and consume events.

How to Enable Event Streaming via Partner Event Bus on Amazon EventBridge

There are four stages to enable event streaming with a partner event bus in Amazon . This event bus receives events pushed by the SaaS partner and delivers them to the event consumer.

Stage 1: Request and enable test (SaaS) accountAction owner: SaaS provider and AWS

The SaaS Provider raises a request to enable their test account by emailing eventbridge-partners@amazon.com. This request includes important fields like:

  • AccountID1: Sender/publisher account
  • AccountID2: Receiver account)
  • APN Partner email/s
  • Regions

It typically takes 2-3 days to enable a test account. Once approved, the SaaS provider can use a test namespace like: AWS.partner/<<companyname>>.test

Stage 2: Perform integration developmentAction owner: SaaS provider and SaaS tenant/customer

Step

Action

Action Owner

API / UI Action

Explanation

1

Create partner event source

SaaS Provider

CreatePartnerEventSource

Enable PartnerEventSoure for any tenant/customer to receive events from the SaaS system.

Here’s a sample page and fields to capture in the UI:

Partner Event on AWS

Important response parameter: EventSourceArn

This will be unique for each tenant/customer.

EventSourceName will be used while pushing tenant specific Events.

2

Publish tenant specific event

SaaS Provider

PutPartnerEvents

Publishes events to the unique EventSourceName created in Step1 for each tenant. ARN to be stored in the SaaS system at tenant/customer level.

3

Create event bus

SaaS Tenant/Customer

UI Action (EventBridge UI) OR CreateEventBus API

The SaaS tenant must configure a partner event bus in their AWS account to receive the events pushed in Step2.

Note: PartnerEventsource is deleted if the customer does not configure rules to consume published events within 6 days.

4

Create event rule

SaaS Tenant/Customer

UI Action (EventBridge UI) OR PutRule API

SaaS tenant must configure a rule to filter and process events received via PartnerEventBus.

 Stage 3: Perform integration development

Action owner: SaaS provider and AWS

AWS will send a questionnaire to the SaaS provider who will then fill it out and submit it after they complete development and testing of the UI and API interface. The questionnaire includes numerous details about the company name, AWS account ID, architecture diagrams, use cases, etc. The provider emails the completed questionnaire to eventbridge-partners@amazon.com. AWS will then provide a date and time on which they will validate the integration.

Stage 4: Validate and enable for production

Action owner: SaaS provider and AWS

In this final stage, the SaaS provider will demonstrate the end-to-end flow to the AWS team. After validation, AWS will enable the provider’s icon in EventBridge’s PartnerEventBus screen.

After these four stages are complete, SaaS customers/tenants can enable EventBridge notifications from the SaaS UI. The overall sequence flow will look something like this:

AWS Event Bus

Conclusion

This article explains how SaaS partners/customers can quickly integrate their applications with Amazon EventBridge for many use cases, such as - archiving and auditin business events in near real-time, configuring custom rules/workflows, analyzing events and create custom automations to perform specific actions on events. Need advice on how to make an event-driven architecture work for you? Want to know how to make the most of Amazon EventBridge to build event-driven applications? Contact Us.

Related Blogs