AnalyticDB for MySQL lets you physically partition computing resources into multiple resource groups. Each resource group has its own CPU, memory, query queues, task types, and configuration parameters. The computing resources of different resource groups are completely isolated. This isolation protects core services from complex computations and burst workloads and helps you efficiently allocate resources to maximize cluster performance. This capability meets the demands for multitenancy and mixed workloads within a cluster. This topic describes the types and application scenarios of resource groups.
Benefits of resource groups
Enterprise, Basic, and Data Lakehouse editions
Resource isolation: Queries from different users or applications can have different resource needs. Resource isolation ensures that latency-sensitive interactive tasks are not affected by long-running, resource-intensive batch processing tasks. For more information, see Execute a query using the resources of a specific resource group.
Priority scheduling: Each resource group has an independent query priority queue. This lets you control which queries are executed first. For more information, see Priority queues and concurrency of Interactive resource groups and Priority queues of Job resource groups.
Offline batch processing: The default Interactive resource group is designed for online interactive analysis. To run offline batch processes without affecting the response speed of online analysis, you can create a Job resource group specifically for this purpose. For more information, see Create and manage resource groups.
Resource elasticity: If your business has predictable peak and off-peak hours, you can configure a scaling plan to automatically add or remove resources at scheduled times. For more information, see Elastic scaling.
You can also set the maximum and minimum available resources. The resource group then automatically scales out or scales in within your defined range based on the workload. For more information, see Multi-Cluster elastic model for Interactive resource groups and Configure the maximum and minimum computing resources for a Job resource group.
Workload management: You can control workloads based on resource groups. For example, if a query's running time exceeds a threshold, you can deliver the query to another resource group for re-execution. This prevents the query from blocking other queries in the original resource group. For more information, see Workload management.
Data Warehouse Edition
Resource isolation: Queries from different users or applications can have different resource needs. Resource isolation ensures that latency-sensitive interactive tasks are not affected by long-running, resource-intensive batch processing tasks. For more information, see Deliver a query to a resource group.
Priority scheduling: Each Interactive resource group has an independent query priority queue. This lets you control which queries are executed first. For more information, see Priority queues and concurrency of Interactive resource groups.
Different query execution modes: You can set the execution mode for queries in batches at the resource group level. For more information, see Query execution modes of a resource group.
Resource elasticity: If your business has predictable peak and off-peak hours, you can configure a scaling plan to automatically add or remove resources at scheduled times. For more information, see Elastic scaling.
Workload management: You can control workloads based on resource groups. For example, if a query's running time exceeds a threshold, you can deliver the query to another resource group for re-execution. This prevents the query from blocking other queries in the original resource group. For more information, see Workload management.
Resource group classification
AnalyticDB for MySQL resource groups are classified into two types based on their creation method: default resource groups, which are created by the system, and custom resource groups, which are created by users.
Enterprise, Basic, and Data Lakehouse editions
Default resource groups
Definition
These resource groups are created automatically when you create a cluster. They are named user_default and serverless.
Properties
Enterprise Edition and Basic Edition:
The computing resources of a default resource group are equal to the reserved resources of the cluster (Number of nodes × Node specifications).
Default resource groups use scheduled scaling.
You cannot modify or delete default resource groups.
The task types of default resource groups cannot be modified:
user_default: Interactive type.serverless: Job type.
You cannot attach database accounts to default resource groups.
Data Lakehouse Edition:
The minimum reserved computing resources for a default resource group is 0 ACU. The maximum is the current unallocated resources of the cluster. The step size is 16 ACU.
You can modify the reserved computing resources of a default resource group.
You cannot modify or delete default resource groups.
The task types of default resource groups cannot be modified:
user_default: Interactive type.serverless: Job type.
You cannot attach database accounts to default resource groups.
Custom resource groups
Definition
You can create custom resource groups of the Interactive or Job type. For more information about how to create a resource group, see Create and manage resource groups or CreateDBResourceGroup - Create a resource group.
Properties
You can modify the resources of a custom resource group. For more information, see Create and manage resource groups.
Interactive resource groups: These are Multi-Cluster elastic resource groups. They can dynamically adjust their resources based on the configured minimum and maximum number of clusters. If the minimum and maximum number of clusters are the same, the resource size is fixed and does not have elastic capabilities.
Job resource groups: The minimum computing resources is 0 ACU. The maximum computing resources you can set in the console is 1024 ACU. The step size is 8 ACU. If you need more resources, you can submit a ticket to contact technical support.
You can delete custom resource groups.
You cannot modify the task type of a custom resource group.
You can attach and detach database accounts to custom resource groups. For more information, see Attach a database account to or detach a database account from a resource group.
You can configure a ThriftServer for a Job resource group. For more information, see Start or stop a ThriftServer.
Data Warehouse Edition
Default resource group
Definition
This resource group is created automatically when you create a cluster. It is named USER_DEFAULT.
Properties
The resources are dedicated. The minimum step size for computing resources is 16 cores and 64 GB, which corresponds to the resources of one compute node. The minimum computing resources can be set to 0 cores and 0 GB. The maximum cannot exceed the total computing resources of the cluster.
You cannot delete the default resource group.
All computing resources not assigned to a custom resource group belong to the default resource group. Therefore, you cannot modify the resources of the default resource group.
The default query type is Default_Type. You can modify the query type. For more information about how to modify the query type, see Modify a resource group. For more information about query types, see Query execution modes.
Database accounts that are not attached to a custom resource group are attached to the default resource group.
Custom resource groups
Definition
You can create custom resource groups of the Default_Type, Batch, or Interactive query type. For more information about how to create a resource group, see Create a resource group or CreateDBResourceGroup - Create a resource group.
Properties
The resources are dedicated. The minimum step size for computing resources is 16 cores and 64 GB, which corresponds to the resources of one compute node. The minimum computing resources can be set to 0 cores and 0 GB. The maximum cannot exceed the total computing resources of the cluster.
You can delete custom resource groups.
You can modify the resources of a custom resource group.
You can modify the query type. For more information about how to modify the query type, see Modify a resource group. For more information about query types, see Query execution modes.
You can attach and detach database accounts. For more information, see Attach a database account to or detach a database account from a resource group.
Feature overview
Enterprise, Basic, and Data Lakehouse editions
Resource groups are classified into Interactive, Job, and AI types based on the tasks they run. The differences are as follows:
Interactive resource groups:
How it works: After a user submits a query to a frontend node, the resident computing resources of the Interactive resource group execute the query using the XIHE Massively Parallel Processing (MPP) or Spark SQL Multi-Cluster mode. The response time is fast, typically in milliseconds or seconds. For more information about the XIHE MPP engine, see XIHE MPP engine. For more information about Spark SQL Multi-Cluster, see Multi-Cluster elastic model.
Scenarios: Online scenarios with high queries per second (QPS) and low response time (RT), or interactive analysis scenarios.
Tasks executed: XIHE MPP SQL and Spark SQL.
Elastic scaling: It scales resources at scheduled times based on a scaling plan or automatically scales resources based on the workload within the specified range of clusters.
Job resource groups:
How it works: After a user submits a query to a frontend node, the frontend node starts temporary computing resources and executes the query using the XIHE Bulk Synchronous Parallel (BSP) mode. The response time is slower, typically in seconds or minutes. The amount of temporary computing resources started is between 0 ACU and the maximum resources of the Job resource group. The specific amount depends on the size of the running task. For more information about the XIHE BSP engine, see XIHE BSP engine.
Scenarios: High-throughput offline scenarios.
Tasks executed: XIHE BSP SQL, Spark SQL, and Spark applications.
Elastic scaling: It scales computing resources in or out on demand.
AI resource groups:
How it works: AI resource groups are deployed based on Ray Clusters. The head node manages metadata, GCS services, and task scheduling, but does not execute tasks. Worker Groups support both CPU and GPU resource types and can dynamically allocate computing resources based on task requirements.
Scenarios: Heterogeneous computing scenarios.
Tasks executed: MLSQL model execution and Ray-managed computing.
Elastic scaling: Worker Groups support automatic scaling, and each Worker Group can scale independently. If there are multiple Worker Groups, the system automatically finds the best match to avoid overloading or idling.
Data Warehouse Edition
Resource groups are classified into Interactive and Batch types based on the tasks they run. The differences are as follows:
Interactive resource groups:
How it works: After a user submits a query, the resident computing resources execute the query using the XIHE MPP mode. The response time is fast, typically in milliseconds or seconds. For more information about the XIHE MPP engine, see XIHE MPP engine.
Scenarios: Suitable for latency-sensitive real-time analysis queries.
Tasks executed: XIHE MPP.
Elastic scaling: It scales resources at scheduled times based on a scaling plan or automatically scales resources based on the workload within the specified range of clusters.
Batch resource groups:
How it works: After a user submits a query, the resident computing resources execute the shared query using the XIHE BSP mode. The response time is in seconds or minutes.
Scenarios: Suitable for queries that have long running times and process large amounts of data. For example, data cleansing queries (Extract-Transform-Load (ETL)).
Tasks executed: Supports XIHE BSP.
Elastic scaling: It scales computing resources in or out on demand.