All Products
Search
Document Center

DataWorks:Add a data source

Last Updated:Aug 26, 2026

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

    1. Log on to the DataWorks console. In the target region, click More > Management Center in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Management Center.

    2. On the Workspace Management page, click Data Sources in the left-side navigation pane to open the data source page.

  1. 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

    Attach a Hologres compute resource

    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

    Attach a ClickHouse compute resource

    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

    Attach a PolarDB-X (DRDS) data source

    Select the Connection String mode to add the data source.

    MySQL

    Supported

    Supported

    Attach a MySQL data source

    N/A

    PostgreSQL

    Supported

    Supported

    Attach a PostgreSQL data source

    N/A

    SQL Server

    Supported

    Supported

    Attach a SQL Server data source

    N/A

    Oracle

    Supported

    Supported

    Attach an Oracle data source

    Select the Connection String mode to add the data source.

    AnalyticDB for MySQL 2.0 (ADS)

    Supported

    Supported

    Attach an AnalyticDB for MySQL 2.0 data source

    N/A

    AnalyticDB for MySQL 3.0

    Supported

    Supported

    Attach an AnalyticDB for MySQL 3.0 data source

    N/A

    AnalyticDB for PostgreSQL

    Supported

    Supported

    Attach an AnalyticDB for PostgreSQL data source

    N/A

    Tablestore (OTS)

    Supported

    Supported

    Attach a Tablestore data source

    MongoDB

    Supported

    Not supported

    Attach a MongoDB data source

    N/A

    MaxCompute (ODPS)

    • Option 1: Acceleration service

    • Option 2: MCQA

    • Option 1: Acceleration service

    • Option 2: MCQA

    StarRocks

    Supported

    Supported

    Attach a StarRocks data source

    N/A

    Doris

    Supported

    Supported

    Attach a Doris data source

    N/A

    SelectDB

    Supported

    Supported

    Attach a SelectDB data source

    N/A

    PolarDB

    Supported

    Supported

    Attach a PolarDB data source

    ApsaraDB for OceanBase

    Supported

    Supported

    Attach an ApsaraDB for OceanBase data source

    SAP HANA

    Supported

    Supported

    Attach an SAP HANA data source

    DB2

    Supported

    Supported

    Attach a DB2 data source

    DM

    Supported

    Supported

    Attach a DM data source

    Amazon Redshift

    Supported

    Supported

    Attach an Amazon Redshift data source

    Lindorm (OLAP)

    Supported

    Supported

    Associate a Lindorm computing resource

    N/A

  2. Test the connectivity of the resource group on the data source configuration page.

    Important

    If the connectivity test fails, check the configuration based on the instructions provided in Troubleshoot connectivity issues.

  3. After the connectivity test with the Data Service resource group succeeds, go back to the Data Service page to start creating Data Service APIs.