All Products
Search
Document Center

Dataphin:Create a PolarDB data source

Last Updated:Jun 23, 2026

Create a PolarDB data source to enable Dataphin to read business data from PolarDB or write data to PolarDB.

Background information

PolarDB is a next-generation relational database developed by Alibaba Cloud, compatible with MySQL and PostgreSQL. Built on a storage-compute decoupled architecture, it delivers elastic scaling, high performance, mass storage, and high reliability. To use PolarDB with Dataphin for data development, create a PolarDB data source first.

Policy description

Only the super administrator, data source administrator, domain architect, and project administrator roles, or custom global roles with the Create Data Source permission, can create data sources.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Management Center > Datasource Management.

  2. On the Datasource page, click +Create Data Source.

  3. On the Create Data Source page, in the Relational Database section, select PolarDB.

    If you recently used PolarDB, you can also find it in the Recently Used section or search for it in the search box.

  4. On the Create PolarDB Data Source page, configure the parameters for connecting to the data source.

    1. Configure the basic information of the data source.

      Parameter

      Description

      Datasource Name

      Enter a name for the data source. The name must meet the following requirements:

      • It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).

      • The name can be up to 64 characters in length.

      Datasource Code

      After you configure the data source code, you can access Dataphin data source tables in Flink_SQL tasks or through the Dataphin JDBC client using the format data source code.table name or data source code.schema.table name for quick consumption. To automatically switch data sources based on the task execution environment, use the variable format ${data source code}.table or ${data source code}.schema.table. For more information, see Dataphin data source table development method.

      Important
      • The data source code cannot be modified after it is configured.

      • You can preview data on the object details page in the asset directory and asset checklist only after the data source code is configured.

      • In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, SelectDB, and GaussDB data warehouse service (DWS) data sources are currently supported.

      Data Source Description

      A brief description of the PolarDB data source. Maximum length: 128 characters.

      Database Type

      Select the database type that matches your PolarDB engine:

      • If the underlying engine of PolarDB is MySQL, select MYSQL.

      • If the underlying engine of PolarDB is PostgreSQL, select POSTGRE_SQL.

      Time Zone

      Time-formatted data in integration nodes is processed based on the current time zone. The default time zone is Asia/Shanghai. Click Modify to select a destination time zone. The following options are available:

      • GMT: GMT-12:00, GMT-11:00, GMT-10:00, GMT-09:30, GMT-09:00, GMT-08:00, GMT-07:00, GMT-06:00, GMT-05:00, GMT-04:00, GMT-03:00, GMT-03:00, GMT-02:30, GMT-02:00, GMT-01:00, GMT+00:00, GMT+01:00, GMT+02:00, GMT+03:00, GMT+03:30, GMT+04:00, GMT+04:30, GMT+05:00, GMT+05:30, GMT+05:45, GMT+06:00, GMT+06:30, GMT+07:00, GMT+08:00, GMT+08:45, GMT+09:00, GMT+09:30, GMT+10:00, GMT+10:30, GMT+11:00, GMT+12:00, GMT+12:45, GMT+13:00, GMT+14:00.

      • Daylight Saving Time: Africa/Cairo, America/Chicago, America/Denver, America/Los_Angeles, America/New_York, America/Sao_Paulo, Asia/Bangkok, Asia/Dubai, Asia/Kolkata, Asia/Shanghai, Asia/Tokyo, Atlantic/Azores, Australia/Sydney, Europe/Berlin, Europe/London, Europe/Moscow, Europe/Paris, Pacific/Auckland, Pacific/Honolulu.

      Data Source Configuration

      Select a configuration mode based on whether your environment separates production and development data sources:

      • If the business data source distinguishes between production data sources and development data sources, select Production + Development Data Source.

      • If the business data source does not distinguish between production data sources and development data sources, select Production Data Source.

      Tag

      You can categorize and tag data sources based on tags. For information about how to create tags, see Manage data source tags.

    2. Configure the connection parameters between the data source and Dataphin.

      If you selected Production + Development Data Source, configure connection information for both environments. If you selected Production Data Source, configure connection information for the production environment only.

      Note

      To achieve environment isolation, configure separate data sources for production and development. Dataphin also supports using the same data source (identical parameter values) for both environments.

      Parameter

      Description

      JDBC URL

      Enter the connection address for your selected database type.

      • MySQL: Format: jdbc:mysql://host:port/dbname

      • PostgreSQL: Format: jdbc:postgresql://host:port/dbname

      Schema

      When PostgreSQL is selected as the database type, configure the Schema. Schema is the database name of the PostgreSQL instance.

      Username, Password

      The username and password for connecting to the PolarDB MySQL or PostgreSQL engine.

    3. Configure advanced settings for the data source.

      Parameter

      Description

      connectTimeout

      The connectTimeout duration of the database (unit: milliseconds), default is 900000 milliseconds (15 minutes).

      Note
      • If you have connectTimeout configuration in the JDBC URL, the connectTimeout will be the timeout period configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default connectTimeout is -1, indicating no timeout limit.

      socketTimeout

      The socketTimeout duration of the database (unit: milliseconds), default is 1800000 milliseconds (30 minutes).

      Note
      • If you have socketTimeout configuration in the JDBC URL, the socketTimeout will be the timeout period configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default socketTimeout is -1, indicating no timeout limit.

      Connection Retries

      If the database connection times out, Dataphin automatically retries until the configured retry limit is reached. If all retries fail, the connection fails.

      Note
      • The default number of retries is 1 time, and you can configure a parameter between 0 and 10.

      • The connection retry count will be applied by default to offline integration tasks and global quality (requires activation of the asset quality function module). In offline integration tasks, you can configure task-level retry counts separately.

  5. Select Default Resource Group, which is used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.

  6. Perform a Test Connection or directly click OK to save and complete the creation of the PolarDB data source.

    Click Test Connection, and the system will test whether the data source can connect normally with Dataphin. If you directly click OK, the system will automatically test the connection for all selected clusters, but even if all selected clusters fail to connect, the data source can still be created normally.