DuckDB-based analytical instances

更新时间:
复制 MD 格式

RDS for MySQL DuckDB-based analytical instances use columnar storage and vectorized execution to accelerate complex analytical queries by 100x while significantly reducing storage costs.

Features

Two types are available:

  • DuckDB-based analytical primary instance

    • A standalone database instance similar to a regular RDS for MySQL primary instance. Available in Cluster Edition with multiple readable standby nodes.

    • Core features:

      • Retains all features of a regular RDS for MySQL instance and is compatible with existing tools and ecosystems. Overview of a DuckDB-based analytical primary instance.

      • Integrates the DuckDB analytical engine into the MySQL kernel, combining columnar storage and vectorized execution to deliver both strong transaction support and high-performance analytical processing.

  • DuckDB-based analytical read-only instance

    • A read-only instance attached to a regular RDS for MySQL High-availability Edition instance.

    • Core features:

      • Seamless data flow: Uses native binlog replication to automatically synchronize data and transform table schemas, eliminating the need for a separate synchronization link.

      • Integrated HTAP: Supports analytical queries through direct connections to the DuckDB read-only instance or automatic routing via a database proxy. This provides hybrid transactional and analytical processing (HTAP), ensuring TP performance of the primary instance while improving analytics efficiency.

Comparison item

DuckDB-based analytical primary instance

DuckDB-based analytical read-only instance

RDS for MySQL read-only instance

OLAP database

Scenario

Complex analytic queries

Complex analytic queries

Transaction processing

Complex analytic queries

Analytic query performance

Strong

Strong

Weak

Strong

Data synchronization method

DTS data synchronization link

Native replication based on binary logging

Native replication based on binary logging

DTS data synchronization link

MySQL compatibility

Data type

Fully compatible

Fully compatible

Fully compatible

Incompatible (requires field mapping)

SQL syntax

Highly compatible (> 99.9%)

Highly compatible (>99.9%)

Fully compatible

Incompatible (requires SQL rewrite)

DDL

Highly compatible

Highly compatible (supports automatic rebuilding)

Fully compatible

Partially compatible

O&M costs

Low

Low

Low

High

Deployment model

Standalone deployment

Attached to a regular RDS for MySQL instance

Attached to a regular RDS for MySQL instance

Standalone deployment

Supported edition

Cluster Edition

High-availability Edition

Basic Edition, High-availability Edition

-

Scenarios

  • Aggregate analysis: Efficient aggregate queries for real-time analysis, such as log data analytics.

  • Multi-table join queries: Significantly improves MySQL analytical performance for workloads involving multi-table JOIN operations.

Free trial and experience

Try a DuckDB analytic instance for free

Enterprise user trial

Enterprise users can try a DuckDB analytic primary instance and a DuckDB-based analytical read-only instance with 8 cores and 16 GB of memory free for one month. For eligible enterprise users, the fee is displayed as 0 on the buy page. You can place an order directly to enjoy the free trial.

  • Trial limits: Each enterprise user can try a DuckDB analytic primary instance and a DuckDB-based analytical read-only instance. For each instance type, you can try the subscription and pay-as-you-go options once each.

  • To try a DuckDB analytic primary instance: Start a subscription trial or a pay-as-you-go trial of a DuckDB analytic primary instance of the myduck.x2.xlarge.xc (dedicated, 8-core 16 GB) instance specification.

  • To try a DuckDB-based analytical read-only instance: Make sure your primary instance meets the prerequisites. You can follow the steps in Create a DuckDB-based analytical read-only instance to configure the following parameters on the buy page. After you complete the configuration, the fee in the lower-right corner of the page changes to 0, indicating a free trial.

    • For Billing Method, select Subscription or pay-as-you-go.

    • For Instance Specification, select myduckro.n2.xlarge.1c or rds.myduckro.n2.xlarge.2 (general-purpose, 8 cores and 16 GB of memory).

    • Set Subscription Duration to 1 Month. This parameter is required only for subscription instances.

    • Each Alibaba Cloud account that has completed real-name verification is eligible for one free trial for each read-only instance specification under each billing method. You can choose to try a DuckDB-based analytical read-only instance with either cloud disks (myduckro.n2.xlarge.1c) or local disks (rds.myduckro.n2.xlarge.2). The trial benefits for these two specifications cannot be combined.

  • If you use the free trial for a subscription instance, the instance is automatically released after the one-month trial period ends. Discounts are available when you renew the trial instance or purchase a new DuckDB instance. The specific discount is displayed on the buy page.

  • If you use the free trial for a pay-as-you-go instance, the instance is not automatically released after the one-month trial period and is billed as a standard pay-as-you-go instance. If you no longer need the instance, release it promptly.

Individual user trial

This program offers a free trial for specific specifications of DuckDB analytic primary instances and DuckDB-based analytical read-only instances. Eligible individual users can log on to the Alibaba Cloud Free Trial Center to create a DuckDB analytic primary instance for a free trial, or add a free-trial DuckDB-based analytical read-only instance from the details page of an RDS for MySQL primary instance.

  • Free trial for DuckDB analytic primary instances:
    A 4-core, 8 GB instance specification is available for a free trial. You can choose to try a Basic series instance (myduck.n2.large.1) for 3 months or a Cluster series instance (myduck.x2.large.xc) for 1 month. The trial benefits for these two options cannot be combined.



  • Free trial for DuckDB-based analytical read-only instances:
    A 4-core, 8 GB instance specification is available for a 3-month free trial. You can choose an instance with high-performance cloud disks (myduckro.n2.large.c) or high-performance local SSDs (rds.myduckro.n2.large.2). The trial benefits for these two options cannot be combined.



Note
  • Each Alibaba Cloud account that has completed real-name verification is eligible for one free trial of a DuckDB analytic primary instance and one free trial of a DuckDB-based analytical read-only instance.

  • The trial instances have a subscription billing method and are automatically released after the trial period ends.

  • Discounts are available when you renew a trial instance or purchase a new DuckDB instance. The specific discount is displayed on the buy page.

Experience complex analytic query capabilities for free

You can go to the Alibaba Cloud ApsaraDB Solutions Experience Center to experience how DuckDB analytic instances accelerate complex SQL queries for free.

Note

Join the RDS Product and Technology User Exchange DingTalk group (ID: 106730000316) to get more information about RDS performance. You can ask questions, share ideas, and provide feedback in the group.

Technical principles

What is DuckDB?

DuckDB is a standalone, embedded OLAP database that balances high-performance analytics with transaction processing:

  • High-performance analytics: Columnar storage accelerates aggregate queries, and the vectorized execution engine processes data in batches.

  • Strong transaction support: Full ACID compliance with MVCC for efficient concurrent reads and writes.

Technical optimizations

ApsaraDB RDS integrates the DuckDB engine into the MySQL ecosystem, combining high-performance analytics with enterprise-grade data reliability and consistency.

Shared optimizations

  • Storage engine optimization

    • Encapsulates DuckDB columnar storage as a MySQL transactional storage engine, using the standard data dictionary for metadata management. Fully compatible with primary instance transaction semantics.

    • Enhances binlog-based synchronization and uses DuckDB write-ahead logging (WAL) for transaction persistence, ensuring data consistency between the RDS instance and the DuckDB analytical instance.

  • Compute engine enhancement

    • Integrates the DuckDB optimizer, vectorized execution engine, and JIT compiler to improve complex query performance by 100x compared with InnoDB.

    • Supports 99.9% of MySQL syntax and functions, so existing queries run without modification.

    • The Result Translator converts DuckDB results into MySQL protocol format for seamless client integration without application changes.

  • Query acceleration

    • Columnar storage: Data stored in DuckDB's native columnar format improves aggregate query performance by over 100x. For example, a SUM query runs 100x faster than on InnoDB.

    • Automatic hot data caching: Uses DuckDB's buffer pool to cache frequently queried data, providing stable performance in high-concurrency scenarios.

Read-only instance optimizations

  • Data synchronization performance improvement

    • Batches high-frequency small transactions into larger ones to reduce write latency.

    • Idempotent replay: Performs idempotence checks on binlog events to ensure strong data consistency.

  • DDL synchronization optimization

    • Automatically routes DuckDB-native DDL operations (such as creating tables and adding or removing columns) directly to the DuckDB engine without conversion.

    • For unsupported DDL operations, automatically triggers a table rebuild to prevent replication interruptions.

  • Resource isolation: The DuckDB read-only instance runs in isolation from the primary instance, so analytical queries do not affect online transaction processing.

Query workflow

  1. SQL parsing: A user's SQL query is parsed by the standard MySQL parser.

  2. SQL execution: The parsed query is routed to the DuckDB compute engine for execution.

  3. Data retrieval: Columnar data is retrieved from the DuckDB storage engine.

  4. Format conversion: The computation result is converted by the Result Translator component into the MySQL protocol format and then sent to the client.

Get started