All Products
Search
Document Center

ApsaraDB RDS:DuckDB analytical instance

Last Updated:Jul 15, 2026

Running complex reports or analytical queries on an ApsaraDB RDS for PostgreSQL instance can consume significant resources, affecting the performance and stability of your core business. To solve this, ApsaraDB RDS for PostgreSQL introduces the DuckDB-based analytical instance. This instance specializes in analytical workloads and uses a dedicated node for read/write splitting to isolate analytical processing (AP) workloads from online transactional processing (TP) workloads. This approach significantly improves the efficiency of complex queries without impacting the performance of the primary instance.

Features

A DuckDB-based analytical instance is a special type of read-only instance designed for analytical queries. It provides the following features:

  • Read/write splitting and workload isolation: It operates as a dedicated node to isolate resource-intensive analytical queries from transactional workloads on the primary instance. This ensures your core business performance and stability are not affected.

  • Zero-ETL real-time columnar conversion: The instance synchronizes data from the primary instance in near real-time by using physical replication and logical subscription, and automatically converts it to a columnar storage format. You can also configure synchronization policies per database.

  • Hybrid row and columnar storage: The instance maintains both a row store copy (original format) and a columnar storage copy (analytical format). Columnar acceleration is enabled by default, routing complex analytical queries to the columnar engine. If the columnar engine cannot process a query, the system automatically falls back to the row store engine for compatibility. The instance also supports row store compression.

Prerequisites

Your ApsaraDB RDS for PostgreSQL primary instance must meet the following requirements:

  • Instance status: Running.

  • Major engine version: ApsaraDB RDS for PostgreSQL 16.0 or later.

  • Edition: High-availability Edition.

  • Billing method: Subscription or pay-as-you-go.

  • Minor engine version: 20260130 or later.

  • The following instance parameters are configured:

    The wal_level parameter is set to logical; shared_preload_libraries includes rds_duckdb; hot_standby_feedback is set to on; and max_replication_slots, max_worker_processes, and max_wal_senders are 1024 or greater.

  • The instance is not a disaster recovery instance.

Billing

The billing for a DuckDB-based analytical instance is the same as for a standard read-only instance. The cost depends on factors such as the edition, instance type, storage type, and storage capacity. The final price is displayed on the buy page.

Usage notes

  • After you create a DuckDB-based analytical instance, do not modify the related parameters on the primary instance.

  • If you create multiple DuckDB-based analytical instances for the same primary instance, the columnar storage configuration, such as which databases are enabled for automatic row-to-column conversion, applies to all analytical instances.

  • If the primary instance is already using the rds_duckdb extension for columnar acceleration, disable this feature on the primary instance after creating the DuckDB-based analytical instance to ensure complete workload isolation.

  • To ensure query compatibility, the DuckDB-based analytical instance maintains a copy of the data in row store format. You can compress this row store data to save on storage costs.

Create a DuckDB analytical instance

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region, and then click the ID of your target instance.

  2. On the Basic Information page, in the Instance Distribution section, click Add to the right of DuckDB-based analytical instance.

    image

  3. A pre-check runs automatically. After the pre-check passes, click Confirm and Activate.

    If the pre-check fails, click One-click Fix and select a time for the fix. The system automatically configures the required dependencies. After the fix is complete, click Add to the right of DuckDB-based analytical instance again to return to the pre-check page. Then, click Confirm and Activate.

    Important

    If the major engine version of your instance does not meet the requirements, you must manually upgrade the major engine version.

  4. Set the parameters for the DuckDB-based analytical instance.

    Parameter

    Description

    Billing Method

    • Subscription: Suitable for long-term use (one-time payment).

    • Pay-as-you-go: Suitable for short-term use (hourly billing). You can create a pay-as-you-go DuckDB-based analytical instance first and then convert it to Subscription after you confirm that it meets your requirements.

    Edition

    • Basic Edition: A single-node DuckDB-based analytical instance that is cost-effective and suitable for learning or testing. Fault recovery and restarts are slow.

    • High-availability Edition (Default): Includes a primary node and a secondary node to provide high availability for the DuckDB-based analytical instance. This edition is suitable for production environments and is recommended for most scenarios.

    Note

    If you select Edition, you must also specify the zone of the primary node, deployment type (multi-zone deployment or single-zone deployment), and zone of the secondary node.

    Product Type

    Only Standard Edition is supported.

    For more information, see Product types.

    Zone

    A zone is an independent physical area within a region. Different zones in the same region are functionally identical. A multi-zone deployment provides zone-level disaster recovery, unlike a single-zone deployment.

    Instance Type

    Only Dedicated instance types are supported. The available specifications are the same as those for ApsaraDB RDS for PostgreSQL read-only instance types.

    Storage Capacity

    The storage capacity includes the space for data, system files, write-ahead logging (WAL) files, and transaction files. The minimum increment for storage capacity adjustments is 5 GB.

    Note

    The storage capacity of a DuckDB-based analytical instance must be at least as large as that of the primary instance. For information about the storage capacity of each instance type, see ApsaraDB RDS for PostgreSQL read-only instance types.

  5. Click Next: Instance Configurations and set the following parameters.

    Parameter

    Description

    Network Type

    This defaults to the same network type, VPC, and vSwitch of Primary Node as the primary instance.

    Release Protection

    If the billing method is pay-as-you-go, you can enable Release Protection for the instance to prevent it from being accidentally released. For more information, see Enable or disable release protection.

    Resource Group

    By default, this is the same as the resource group of the primary instance and cannot be changed.

    Time Zone

    By default, this is the same as the time zone of the primary instance.

    SLR Authorization

    No configuration is required. Authorization was granted when the primary instance was purchased.

    Instance name

    Set a name for the instance to easily identify it.

  6. Click Next: Confirm Order.

  7. Confirm the Parameter Configurations, select the Quantity and Subscription Duration if you chose a Subscription plan, and then click Confirm Order to complete the payment.

Configure columnar storage

To accelerate analytical queries, a DuckDB-based analytical instance uses columnar storage, which requires you to first convert data from the primary instance's row store format.

You can convert a single table on demand or automatically convert an entire database, depending on your business requirements and resource availability.

Prerequisites

Before you begin, make sure that the ApsaraDB RDS for PostgreSQL primary instance meets the following requirements:

Usage notes

  1. Generating columnar storage data consumes additional storage space, typically 20% to 50% of the original data volume. Ensure that the DuckDB-based analytical instance has sufficient available storage.

  2. For large databases, converting the entire database may take a long time. The conversion time depends on factors such as instance specifications, including disk bandwidth and memory.

Method 1: Convert tables on demand

This method converts specified tables to columnar storage. It is suitable for targeted optimization of slow SQL queries (by converting the tables involved in the query) or for saving storage space when analytical instance resources are limited. If a query involves tables that have not been converted, the system automatically falls back to the row store engine to maintain compatibility.

Procedure

Connect to the ApsaraDB RDS for PostgreSQL primary instance and run the following SQL statements in the target database:

-- Create the rds_duckdb extension if it does not already exist.
CREATE EXTENSION IF NOT EXISTS rds_duckdb;
-- Convert the specified table to columnar storage format.
SELECT rds_duckdb.create_duckdb_table('your_table_name');

Method 2: Convert an entire database

This method uses the console to automatically convert all current tables within a specified database to columnar storage format. It is suitable for scenarios that require comprehensive analysis of an entire database.

Note

This process does not automatically convert tables that are added later. You must reconfigure new tables through the console.

  1. Log on to the ApsaraDB RDS console. In the navigation pane on the left, click Instances. In the top navigation bar, select a region.

  2. In the instance list, find the primary instance (indicated by the image icon) and expand its drop-down list.

  3. Click the ID of the DuckDB-based analytical instance.

    image

  4. In the navigation pane on the left, click Database Management.

  5. On the Database Management page, select the checkboxes of the databases that you want to automatically convert to columnar storage, and then click Batch Configure Columnar Storage.

  6. In the dialog box that appears, click OK.

References