Before you use Data Service to create an API, you must add your database or data warehouse to DataWorks as a data source. Then, you can use the data source as the data backend for Data Service APIs. During API development, Data Service accesses the data source to obtain the schema of a data table based on which you want to create an API to help you configure the request parameters and response parameters of the API. This topic describes how to configure a data source.
Prerequisite
You must configure network connectivity and allowlists to ensure that data can be accessed between data sources and service resource groups. If you do not complete these configurations, Data Service tasks cannot run as expected. For more information, see Network connectivity solutions.
Procedure
-
-
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Management Center.
-
On the Workspace Management page, click Data Sources in the left-side navigation pane to open the data source page.
-
-
On this page, configure a data source as needed. The following table describes the supported data source types and the configuration methods.
Data source type
Create an API in wizard mode
Create an API in script mode
Configuration method
Description
Hologres
Supported
Supported
Hologres is compatible with PostgreSQL. PostgreSQL does not support the DATETIME data type. If your data contains the DATETIME type, Data Service maps it to the PostgreSQL TIMESTAMP type for queries.
ClickHouse
Supported
Supported
This data source supports only serverless resource groups (recommended) or exclusive resource groups for Data Service.
RDS
Supported
Supported
RDS includes RDS MySQL, RDS PostgreSQL, and RDS SQL Server. When you configure the corresponding data source, set Configuration Mode to ApsaraDB for RDS.
PolarDB-X (DRDS)
Supported
Supported
Select the Connection String mode to add the data source.
MySQL
Supported
Supported
N/A
PostgreSQL
Supported
Supported
N/A
SQL Server
Supported
Supported
N/A
Oracle
Supported
Supported
Select the Connection String mode to add the data source.
AnalyticDB for MySQL 2.0 (ADS)
Supported
Supported
N/A
AnalyticDB for MySQL 3.0
Supported
Supported
N/A
AnalyticDB for PostgreSQL
Supported
Supported
N/A
Tablestore (OTS)
Supported
Supported
-
Select the Connection String mode to add the data source.
-
This data source supports only serverless resource groups (recommended) or exclusive resource groups for Data Service.
-
Supported regions: China (Shanghai) and China (Hong Kong).
MongoDB
Supported
Not supported
N/A
MaxCompute (ODPS)
-
Option 1: Acceleration service
-
Option 2: MCQA
-
Option 1: Acceleration service
-
Option 2: MCQA
-
Data source configuration method: Attach a MaxCompute compute resource
-
API configuration method: Create a MaxCompute API
-
Option 1:
-
Only single-table queries are supported.
-
You can use serverless resource groups (recommended), exclusive resource groups for Data Service, or shared resource groups for Data Service.
-
-
Option 2:
-
Both single-table queries and multi-table join queries are supported.
-
This option supports only serverless resource groups (recommended) or exclusive resource groups for Data Service.
-
-
Supported regions: China (Beijing), China (Hangzhou), China (Shanghai), and China (Shenzhen).
StarRocks
Supported
Supported
N/A
Doris
Supported
Supported
N/A
SelectDB
Supported
Supported
N/A
PolarDB
Supported
Supported
-
This data source supports only serverless resource groups (recommended) or exclusive resource groups for Data Service.
-
Supported regions: China (Beijing), China (Hangzhou), China (Shanghai), and China (Shenzhen).
ApsaraDB for OceanBase
Supported
Supported
SAP HANA
Supported
Supported
DB2
Supported
Supported
DM
Supported
Supported
Amazon Redshift
Supported
Supported
Lindorm (OLAP)
Supported
Supported
N/A
-
-
Test the connectivity of the resource group on the data source configuration page.
ImportantIf the connectivity test fails, check the configuration based on the instructions provided in Troubleshoot connectivity issues.
-
After the connectivity test with the Data Service resource group succeeds, go back to the Data Service page to start creating Data Service APIs.