tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Forming Data Lake with SCF + COS

PDF
Focus Mode
Font Size
Last updated: 2024-12-02 16:35:34

Overview

The data lake formation scheme of the serverless architecture is to capture and record the information of a batch of data after starting a data call through a function trigger. This implements various capabilities such as structure conversion, data format conversion, and data compression in the function. In this document, SCF and COS are used to back up TDMQ messages.

Directions

Creating COS bucket

1. Log in to the COS console.
2. Select Bucket List on the left sidebar and click Create Bucket to create the source COS bucket.
3. Set the Name to scf-data-lake, the Region to Guangzhou, and the Access Permission to Private Read/Write (default), and click OK.

Creating TDMQ resources

1. Create resources such as cluster and topic in the TDMQ console. For more information, see Resource Creation and Preparation.
2. Connect the TDMQ cluster to a VPC. For more information, see VPC Access.

Configuring function through COS app integration

1. Log in to the COS console.
2. Select App Integration on the left sidebar and select TDMQ Message Backup in Data Migration and Backup as shown below:


3. On the TDMQ Message Backup page, select the region of the created COS bucket and click Add Function.
4. In the Create TDMQ Message Backup Function pop-up window, enter the Function Name such as data-lake, associate the created scf-data-lake bucket, select Authorize SCF Service, and then click Next.
5. Click Next to configure TDMQ as follows:
Cluster: A TDMQ cluster as the message source. Only TDMQ clusters in the same region are supported.
Namespace: A namespace in the cluster
Topic: A topic used as the message source
Subscription: Select a subscription. If existing subscriptions cannot meet your needs, you can create a new one in Consumption Management in the TDMQ console.
Start Point: Start point of historical messages
Role: Select the TDMQ role (a TDMQ-specific concept, which is different from that mentioned in Tencent Cloud), which is the minimum unit for permission division within TDMQ. You can create multiple roles and grant them different message production/consumption permissions in different namespaces.
Role Key: Select the TDMQ role key, which is an authentication tool. You can add a key in the client to access TDMQ to produce/consume messages. Each role has a unique key corresponding to itself.
Address: It must be a VPC access address.
Note:
There must be an available IP in the VPC subnet, and DHCP must be supported.
6. Click Next to configure delivery. The configuration item is as follows:
Delivery Path: It is the delivery path prefix of the backups. If it is not specified, backups will be stored in the root directory of the bucket. The specified prefix must end with a slash (/).
7. Click Confirm. You can perform the following operations on the created function:
Click View Log to view the historical running status of TDMQ message backup. If an error is reported, you can click View Log to quickly redirect to the SCF console to view the error log details.
Click Edit to modify a TDMQ message backup rule.
Click Delete to delete an unwanted TDMQ message backup rule.

Testing function

1. Log in to the TDMQ console.
2. Click Topic Management on the left sidebar and select the target region, cluster, and namespace.
3. On the Topic Management list page, click Send Message on the right of the associated topic.
4. Enter the message content of up to 64 KB in the pop-up window.
5. Click Submit.
6. Go to the details page of the associated COS bucket. For example, check whether a file has been created in the Delivery Path defined in scf-data-lake, and if so, the TDMQ message backup is successful.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback