AnalyticDB MySQL Elastic Cluster can be used in interactive or batch mode. You can use the two modes in combination with resource pools to support hybrid loads.

Background information

AnalyticDB MySQL Elastic Cluster is a real-time online analytical processing (RT-OLAP) service that is developed by Alibaba Cloud to analyze large amounts of data at high concurrency. AnalyticDB for MySQL can instantly analyze large amounts of data across multiple dimensions and provide data-driven insights to your business. AnalyticDB for MySQL utilizes an execution engine that integrates massively parallel processing (MPP) with directed acyclic graphs (DAGs). This enables AnalyticDB for MySQL to instantly compute data by using memory. Analytic queries lead to a variety of loads, including low-latency real-time analysis queries and high-throughput extract-transform-load (ETL) queries. You can perform real-time analysis queries with low latency based only on memory. ETL queries have low requirements on query latency but require lower processing costs and higher throughput.

To manage the preceding issues, AnalyticDB for MySQL provides the batch mode based on the original interactive mode in which only memory is used for computing. Unlike the interactive mode, the batch mode can be used to execute query tasks in batches. When memory is insufficient, each subtask can transfer memory data to disks. This can reduce computing costs and increase data processing capacities.

interactive mode

After AnalyticDB for MySQL receives queries from users, it parses the queries and uses the optimizer to generate execution plans. The execution engine receives the execution plans and then generates corresponding distributed execution tasks. These distributed execution tasks are computed based on the logic described in the execution plans. The execution engine schedules and manages these distributed execution tasks.

In interactive mode, all the distributed execution tasks of a query are scheduled and executed at the same time. Each task is computed based only on memory. Data is transferred between upstream and downstream tasks in a pipelined manner.

batch mode

In batch mode, the execution engine schedules distributed execution tasks in batches based on their dependencies. If memory is insufficient while tasks are being computed, data is automatically transferred to disks to increase data processing capacities. Intermediate data generated during computing is also written to disks. When downstream tasks are scheduled to be executed, intermediate data is read from disks for computing.

Default query execution mode

Service mode Edition Default query execution mode batch mode
Reserved mode Basic Edition interactive Supported
Cluster Edition Not supported
Elastic mode Cluster Edition (new edition) Supported

Switch query execution modes

  • You can switch the query execution mode of a cluster.
    • Execute the following statement to switch the query execution mode of a cluster to interactive:
      set adb_config query_type=interactive
    • Execute the following statement to switch the query execution mode of a cluster to batch:
      set adb_config query_type=batch
  • You can switch the query execution mode of a resource pool. For more information, see Modify a resource pool.

Hybrid loads

AnalyticDB for MySQL resource pools allow you to support multiple tenants within a cluster. You can set query execution modes for different resource pools. This way, a cluster can support concurrent hybrid query loads. For more information, see Resource pool overview.