Cloud Native 13 min read

Design and Practice of Tencent Cloud Native Database TDSQL-C Serverless Architecture

TDSQL‑C Serverless separates compute and storage, delivers instant elastic scaling for MySQL and PostgreSQL, charges per‑second usage, pauses and stops billing when idle, and supports low‑frequency, archival, development, and micro‑service workloads with a ~2‑second cold‑start.

Tencent Cloud Developer
Tencent Cloud Developer
Tencent Cloud Developer
Design and Practice of Tencent Cloud Native Database TDSQL-C Serverless Architecture

TDSQL-C Serverless was launched to meet higher elasticity and precise billing requirements, offering lower cost and more flexible cloud database services. The content is based on a talk by senior engineer Yang Jueji at ServerlessDays China 2021.

1. Serverless Database Features – Serverless combines FaaS (Function as a Service) and BaaS (Backend as a Service). Unlike traditional cloud databases that require fixed specifications, TDSQL‑C Serverless provides three key advantages: automatic elastic scaling, usage‑based billing, and zero charge when idle.

2. TDSQL‑C Architecture – The product consists of two variants (MySQL and PostgreSQL). The MySQL variant separates compute and storage layers. The compute layer uses TXSQL, fully compatible with MySQL, while the storage layer relies on the HiSTOR platform built on CBS. Logs are off‑loaded to storage, and a custom DBStore component replays logs and provides push‑down operators. This separation enables flexible resource allocation for the compute layer, which is the foundation of the Serverless capability.

3. Automatic Scaling and Billing – Scaling is driven by CPU and memory monitoring. Users set a minimum and maximum specification (e.g., 1 CPU 2 GB → 2 CPU 4 GB). When load exceeds the minimum, the system expands to the maximum instantly, achieving second‑level scaling without user perception. Billing is performed every 5 seconds based on a computed CCU (CPU‑Memory Unit). The system charges per actual usage (e.g., 0.6 CPU) and generates hourly invoices.

4. Zero‑Charge When Idle – If no requests are detected for 10 minutes, the instance is paused, releasing compute resources and stopping billing. A subsequent request triggers a cold‑start (currently ~2 seconds) that resumes the compute layer. This mechanism is crucial for archival databases, low‑frequency workloads, and development/testing environments.

5. Application Scenarios

• Slow‑query handling – pay low CCU during normal operation and higher only when a slow query spikes load.

• Scheduled tasks – handle bursty nightly workloads without over‑provisioning.

• Archival databases – automatically pause when not accessed, ideal for education, research, or infrequently used data.

• Low‑frequency services – personal blogs, small forums, mini‑programs can run on minimal specs and pause when idle.

• Development & testing – developers can spin up instances during work hours and pause them after hours, reducing cost.

• Micro‑service isolation – each micro‑service can have its own lightweight Serverless DB, improving isolation and performance.

6. Summary – TDSQL‑C Serverless fills the gap of relational Serverless databases, offering instant elastic scaling, per‑second usage billing, and zero cost when idle. Current cold‑start time is 2 seconds, with ongoing optimizations. The solution also targets startups by providing low‑cost, low‑maintenance, highly available databases with fast provisioning and automatic backup.

cloud nativeDatabaseauto scalingServerlessTDSQL-CUsage Billing
Tencent Cloud Developer
Written by

Tencent Cloud Developer

Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.