Author: Zhao Hai

The introduction

EventBridge is a serverless event bus service provided by Ali Cloud. It supports standardized and centralized access of Ali Cloud services, custom applications and SaaS applications, and can route events among these applications using standardized CloudEvents 1.0 protocol. Helps you easily build loosely coupled, distributed event-driven architectures. Event-driven architecture is a loosely coupled and distributed driver architecture. After collecting events generated by an application, events are processed in real time and routed to the downstream system without waiting for system response. EventBridge, an event bus, can be used to build a variety of simple and complex event-driven architectures to connect cloud products and applications, applications and more, using the standardized CloudEvents 1.0 protocol. For more information about EventBridge see [1] EventBridge Event Bus and EDA Architecture

Event Target is the core module of EventBridge, which is responsible for event processing terminal and consumption events. For DB services from other cloud vendors and verticals in the market, EventBridge has released database Sink based on the event target module, which provides simple and easily integrated DB drop-off capabilities to help developers implement business cloud more efficiently and conveniently.

Database Sink Overview

The database Sink event target is one of the event targets supported by EventBridge. The main capability is to post data to a specified database table through EventBridge.

Thanks to the EventBridge ecosystem, Database Sink supports multiple access methods:

• Aliyun cloud product events, EventBridge supports cloud service bus, through simple configuration can be directly cloud service related events into the library operation; • SaaS application events, EventBridge supports tripartite access to SaaS events, and supports database and query of SaaS triggered events; • Customizable applications that can be accessed using EventBridge’s official APIS, multilingual clients, HTTP Sources, and open Source clients from the CloudEvents community. Database Sink capabilities focus on how to convert semi-structured Json data from EventBridge services into structured SQL statements, providing interactive access to LowCode to help developers one-stop data entry into the database.

Database Sink best practices

Typical cases:

• If you want to store some MNS consumption messages or RocketMQ consumption messages in a specified database table for later data analysis and troubleshooting, you can also add data to the database table in this way;

• Some important logs or buried data are directly stored in the DB using HTTP event sources, which does not need to go through the user service system, facilitating subsequent scenario analysis.

Introduction to use:

At the present stage, database Sink For MySQL supports two modes: one is RDS MySQL (VPC) based on Aliyun, and the other is user-built MySQL (public network), which can be accessed in different ways according to business scenarios.

Step 1: Click the event rule and create the event rule

Step 2: Select the event source

You can choose ali Cloud official or custom event source

Step 3: Select the event target

1) Select database under the service type of the event target, then there will be two options: one is RDS MySQL of Ali Cloud, the other is self-built MySQL;

2) If it is Ali Cloud RDS MySQL, the associated role of the service needs to be created.

3) After authorization, you can select the instance ID and database name of the RDS MySQL database created by users. The database account and password must be set manually. The concurrent configuration can be set based on service requirements. Because RDS MySQL involves cross-geographical access, it requires the support of a private network VPC.

Step 4: Warehouse configuration

Quick configuration and customized SQL are supported:

1) Fast configuration, support LowCode method to quickly select the library content.

2) Custom SQL, support custom advanced SQL syntax.

Step 5: Release events

When created successfully, events can be published via the console:

Step 6: Event status tracking and query

Based on the event ID in the previous step, you can view detailed information about the track, including whether the event is successfully executed. If the event fails to be executed, exception information is displayed on the page.

You can also see the detailed event track through event tracking:

conclusion

This article highlights a new feature of EventBridge: the database Sink event target.

As a serverless event bus service, EventBridge has integrated aliyun product control link data and message product business data into the event source ecosystem, improving the convenience of business integration for Users of Shanghai Cloud, and meeting the support of Open API and multi-language SDK. On this basis, EventBridge has integrated aliyun product control link data and message product business data into the event source ecosystem. Data is posted to a specified database table through EventBridge, facilitating the customer’s own business access to EventBridge.

A link to the

[1] more EventBridge introduce developer.aliyun.com/article/878…

[2] RDS official documentation www.aliyun.com/product/rds…

[3] EventBridge help.aliyun.com/product/161 official document…

To learn more about EventBridge, scan the QR code below to join the Studs group

Click here to learn more about EventBridge! Release the latest information of cloud native technology, collect the most complete content of cloud native technology, hold cloud native activities and live broadcast regularly, and release ali products and user best practices. Explore the cloud native technology with you and share the cloud native content you need.

Pay attention to [Alibaba Cloud native] public account, get more cloud native real-time information!