Building Database Application Integration Based on EventBridge

Introduction

EventBridge is a serverless event bus service provided by Alibaba Cloud, which supports standardized and centralized access to Alibaba Cloud services, custom applications, and SaaS applications. It can route events between these applications using the standardized CloudEvents 1.0 protocol, helping you easily build a loosely coupled and distributed event driven architecture. Event driven architecture is a loosely coupled and distributed driver architecture that collects events generated by an application and takes necessary actions in real-time, then routes them to downstream systems without waiting for system responses. Using the Event Bus EventBridge, various simple or complex event driven architectures can be constructed to connect cloud products and applications, applications and applications, etc. using standardized CloudEvents 1.0 protocol. For more information on EventBridge, please refer to [1] "Analysis of EventBridge Event Bus and EDA Architecture"

The Event Target is responsible for processing terminals and consuming events, and is the core module of the EventBridge. For DB services from other cloud vendors and vertical fields in the market, EventBridge has released a database Sink based on event target modules, providing a simple and easy to integrate DB drop off capability, helping developers achieve more efficient and convenient business cloud deployment.

Overview of Database Sink

Database Sink event targets are a type of event targets supported by EventBridge, with the main capability of delivering data to specified database tables through EventBridge.

Thanks to the EventBridge ecosystem, the database Sink supports numerous access methods:

Alibaba Cloud product events, EventBridge supports cloud service bus, and can directly perform inbound operations on cloud service related events through simple configuration;

• SaaS application events, EventBridge supports third-party SaaS event access, and supports logging and querying of SaaS triggering events;

User defined application, users can use the official API interface of EventBridge, multilingual client, HTTP Source, and open source client of CloudEvents community to complete access.

The focus of database Sink capability is on how to convert semi-structured Json data from EventBridge business into structured SQL statements, providing LowCode interactive access, and helping developers complete data warehousing in a one-stop manner.

Database Sink Best Practices

Typical case:

I hope to store some MNS consumption messages or RocketMQ consumption messages in a designated database table for future data analysis and message troubleshooting, or I can add data to the database table in this way;

Store important logs or buried data directly in the DB through HTTP event sources, without the need for user business systems, which can facilitate subsequent customer scenario analysis.

Usage Introduction:

Firstly, at present, the Sink For MySQL database supports two methods: one is based on Alibaba Cloud's RDS MySQL (VPC), and the other is user built MySQL (public network), which can be accessed in different ways according to business scenarios.

Step 1: Click on the event rule and create it

Step 2: Select the event source

You can choose between Alibaba Cloud official or custom event sources

Step 3: Select the event target

1) Select a database for the service type under the event target, and there will be two options: one is Alibaba Cloud's RDS MySQL, and the other is self built MySQL;

2) If it is Alibaba Cloud RDS MySQL, it is necessary to create an associated role for the service.

3) After authorization, users can choose the instance ID and database name of the RDS MySQL database they have created themselves.

The database account and password need to be manually filled in, and concurrent configuration can be filled in according to actual business needs. Because RDS MySQL involves cross regional access, it requires the support of VPC in a proprietary network.

Step 4: Warehousing Configuration

The inbound configuration supports two methods: quick configuration and custom SQL:

1) Quick configuration, supporting LowCode method for quick selection of inbound content.

2) Customized SQL, supporting customized advanced SQL syntax.

Step 5: Event Release

After successful creation, event publishing can be done through the console:

Step 6: Event Status Tracking and Query

You can see detailed information about the trajectory through the event ID in the previous step, including information on whether the event execution was successful or not. If the event execution fails, abnormal information will be displayed on the page.

Detailed event trajectories can also be seen through event tracking:

Summary

This article focuses on the new feature of EventBridge: database Sink event targets.

As a serverless event bus service, EventBridge has integrated Alibaba Cloud product control link data and message product business data into the event source ecosystem, improving the convenience of cloud user business integration and meeting the support of Open API and multilingual SDK. Based on this, EventBridge delivers data to designated database tables, providing convenience for customers' own business access to EventBridge.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us