Databend is a next-generation cloud-native data warehouse developed in Rust. It is specifically designed for cloud architecture. Built on object storage, it offers businesses integration with data lakes and warehouses while providing a big data analytics platform that separates compute from storage.
This document will guide you on how to import data from AutoMQ into Databend using bend-ingest-kafka.
Environment Preparation
Prepare Databend Cloud and Test Data
Firstly, visit Databend Cloud to initiate a Warehouse. Then, create databases and test tables within the worksheet.
Prepare AutoMQ and Test Data
Refer to Deploy Multi-Nodes Cluster on Linux▸ to set up AutoMQ, making sure there’s network connectivity between AutoMQ and Databend.
Quickly create a topic named example_topic in AutoMQ and write test JSON data into it by following these steps.
Create Topic
Use Apache Kafka command-line tools to create a topic. Ensure you have access to the Kafka environment and that the Kafka service is running. Below is an example command for creating a topic:
When executing commands, replace topic and bootstrap-server with the actual Kafka server addresses.
After creating the topic, you can use the following command to verify whether the topic has been successfully created.
Generate Test Data
Generate test data in JSON format that corresponds to the previously mentioned table.
Write Test Data
Use Kafka’s command-line tools or programming methods to write test data into a topic named example_topic. Here is an example using command-line tools:
When executing the command, replace the topic and bootstrap-server with the actual Kafka server address being used.
You can view the topic data just written using the following command:
Create a Bend-ingest-databend Job
bend-ingest-kafka is designed to monitor Kafka and batch write data into a Databend Table. After deploying bend-ingest-kafka, the data import job can be initiated.
When executing the command, replace kafka-bootstrap-servers with the actual Kafka server address you are using.
Parameter Description
databend-dsn
The DSN provided by Databend Cloud for connecting to the warehouse can be found in this documentation.
batch-size
bend-ingest-kafka will gather data until it reaches the specified batch size, then initiate a data synchronization process.
Verify Data Import
Navigate to the Databend Cloud worksheet and query the automq_db.users table. You should confirm that the data has been successfully synchronized from AutoMQ to the Databend Table.
