How can I select a suitable TencentDB for MySQL instance?
Before you purchase a TencentDB for MySQL instance, you need to learn about the characteristics of different instances. The following describes how to select a suitable instance based on your business needs.
Overview
To purchase a suitable instance that is the most cost-effective, you need to consider the price, performance, workload, and business scenarios of the instance. The database storage engine, instance architecture, storage type, and isolation strategies are closely related. The following details the four factors to help you purchase a suitable instance.
1. Database storage engine
The storage engine of a database indicates the table type and determines the way of table storage.
InnoDB: It is the most commonly used OLTP storage engine. It adopts the multi-version concurrency control (MVCC) and row-level locking technologies to provide high-performance and reliable transaction processing capabilities. Compared with other storage engines of MySQL, InnoDB performs better in ensuring data integrity as it supports foreign key constraints and rollbacks. It also provides more advanced query features. Besides, Tencent Cloud has optimized the kernels of InnoDB, making it suitable for high-performance and high-concurrency scenarios.
RocksDB: It is a high-performance and persistent key-value (KV) storage engine. By leveraging the LSM tree storage structure of RocksDB, Tencent Cloud's TXSQL team developed the TXRocks transactional storage engine which not only reduces wastes caused by InnoDB's half-full pages and fragments, but also uses the compact storage format. Therefore, TXRocks has a performance comparable to that of InnoDB but requires only a half or even smaller storage space. It is more suitable for businesses with a large data volume and high requirements for the transactional read/write performance.
2. Instance architecture
TencentDB for MySQL supports single-node, two-node, and three-node instance architectures.
Architecture
Note
Scenarios
Single-Node
Supported for: MySQL 5.7/8.0.
Node: One single node.
Personal learning, small websites, non-core small enterprise systems, and medium-to-large enterprise development and testing.
Two-Node
Supported for: MySQL 5.6/5.7/8.0.
Node: One source node and one replica node.
Source-replica replication mode: Async (default), and semi-sync.
The gaming, the internet, IoT, retail, e-commerce, logistics, insurance, and securities industries.
Three-Node
Supported for: MySQL 5.6/5.7/8.0.
Node: One source node and two replica nodes.
The three-node architecture supports such source-replica replication modes as async (default), strong sync, and semi-sync.
The gaming, the internet, IoT, retail, e-commerce, logistics, insurance, and securities industries.
3. Storage type
The local SSD, cloud SSD, and enhanced SSD are supported for the underlying storage of TencentDB for MySQL.
Performance Metrics
Enhanced SSD
SSD cloud disk
Local SSD
Max capacity per disk (GB)
30000
30000
12000
Max IOPS of a single disk
Up to 100000 after stacking extra performance
26000
150000
Random IOPS performance
Basic performance: Random IOPS = min{1,800 + capacity (GiB) × 50, 50,000}
Extra performance: Max IOPS = min{extra performance ×128, 50,000}. For more information, see Enhanced SSD Performance.
Random IOPS = Min {1800 + Capacity (GiB) x 30, 26000}
Basic performance: Throughput = min{120 + capacity (GiB) × 0.5, 350}
Extra performance: Throughput = min{extra performance ×1, 650}. For more information, see Enhanced SSD Performance.
Throughput = Min {120 + Capacity (GiB) x 0.2, 260}
-
One-way random read/write latency (ms)
0.2 - 1
0.5 - 3
In microseconds (μs)
4. Isolation policy
The table below describes three resource isolation policies of TencentDB for MySQL: Basic, general, and dedicated.
Resource isolation policy
Description
Basic
A basic single-node instance (formerly Basic Edition) supports computation-storage separation and stores data on cloud disks. Only single-node instances support this policy.
General
A general instance exclusively uses the allocated memory and disk resources and shares the CPU resources with other general instances on the same physical machine.
A general instance benefits from higher specifications at a lower cost by sharing CPU resources.
A general instance's disk capacity is unaffected by its CPU and memory specs.
Dedicated
A dedicated instance has exclusive access to the CPU, memory, and disk resources (if CPU pinning is enabled). It has long-term stability and is unaffected by the activities of other instances on the physical machine.
A dedicated instance with the highest configurations can monopolize a physical machine and all of its resources.
Getting started
You can follow the steps below to select an instance:
1. Selecting a Database Storage Engine
If your database needs to have better performance in transaction processing and high-concurrency read/write capabilities, InnoDB is recommended.
If you want to save the storage cost, RocksDB is recommended. This is because RocksDB and InnoDB have similar performance while the former saves half of or even more storage space.
2. Select Instance Architecture
Single-node: This architecture is suitable for scenarios such as personal learning, small websites, non-core small enterprise systems, and medium-to-large enterprise development and testing.
Two-node: This is a high-availability architecture with one source node and one replica node. It is suitable for the internet, IoT, retail, e-commerce, logistics, and gaming industries or medium-to-large enterprises.
Three-node: This architecture has finance-grade reliability, security, availability, and disaster recovery capabilities. It is suitable for the finance, securities, and insurance industries or the core databases of large enterprises.
3. Select storage type
Local SSD storage is supported for two-node and three-node instances; cloud SSD storage and enhanced SSD storage are supported for single-node instances.
Based on the cloud-native architecture, the single-node instance of cloud disk edition offers a storage space of up to 30 TB. It is suitable for scenarios such as testing, development, and personal learning. The IOPS is affected by the storage space.
For the performance metrics comparison between different storage types, see Storage type.
4. Select isolation strategy and instance specifications
The single-node architecture supports the "basic" isolation policy while the two-node and three-node architectures support the "general" and "dedicated" isolation policies. The instance specification parameters include vCPU, memory, max IOPS, and max storage capacity. You can select a suitable isolation policy and instance specification based on your business needs.