What Is a Serverless Instance?
Context
The stability and reliability of databases are crucial for enterprise-grade IT systems. If a database is not stable, the entire system cannot run properly. To ensure smooth database operation during peak hours, users typically configure various parameters and redundant resources (such as compute, memory, and storage).
However, during off-peak hours, those redundant resources are often left idle, resulting in wasted costs. Even with those configurations, there is still a risk of temporary resource shortages in the face of unexpected surges in workloads, which can compromise the overall system.
Apart from the typical enterprise users, there are also many users who occasionally use small-scale databases only for development and testing, applet development, and school laboratory teaching. Those users often have minimal specification requirements but demand workload continuity. Constantly creating or deleting pay-per-use instances is not feasible, and buying low-spec yearly/monthly instances results in a significant waste of money when there are no workloads to process.
To address those concerns, TaurusDB has introduced serverless instances. These instances can dynamically adjust resources based on workloads and are billed on a pay-per-use basis, helping customers speed up data processing at lower costs. Additionally, serverless instances make it easier for small- and medium-sized enterprises to use cloud databases.
The following figure shows the resource usage and specification changes of regular and serverless instances during significant workload fluctuations.
As shown in the figure, regular and serverless instances perform differently during significant workload fluctuations.
- Regular instances: Resources are wasted during off-peak hours and insufficient during peak hours, which will affect workloads.
- Serverless instances: The specifications are adjusted based on workload demands to achieve minimal resource wastes. Even during peak hours, workload demands can still be met, ensuring workload continuity and improving system stability.
How a Serverless Instance Works
TaurusDB serverless instances use a write once read many (WORM) architecture and shared storage. They provide the ability to dynamically scale with system workloads. Each instance node can vertically scale CPUs and memory in seconds and horizontally scale read replicas. It means that compute can quickly and independently adapt to the peaks and troughs, achieving high cost-effectiveness.
- Both the primary node and read replicas are serverless. They use distributed shared storage and can be scaled based on workload changes.
- The billing unit is TaurusDB Capacity Unit (TCU). 1 TCU is approximately equal to 1 CPU and 2 GB of memory. When the primary node or a read replica is scaled, its TCUs increase or decrease accordingly.
- When creating a serverless instance, you can specify a TCU range, instead of configuring specific specifications. Then the instance can be scaled based on the CPU usage and memory usage.
Vertical scaling: The node performance (CPU and memory specifications) changes.
Cloud Eye monitors the CPU usage and memory usage of serverless instances. If any of the following conditions is met, a scale-up is automatically triggered:
- The CPU usage is greater than 80% for 5 seconds and it has been at least 5 seconds since the last scale-up.
- The memory usage is greater than 80% for 5 seconds and it has been at least 5 seconds since the last scale-up.
- The CPU usage is greater than 60% for 20 seconds and it has been at least 10 seconds since the last scale-up.
If the following condition is met, a scale-down is automatically triggered:
The CPU usage is less than 30% for 15 seconds and it has been at least 15 seconds since the last scale-down.
Horizontal scaling: The number of read replicas changes.
If the compute has already been scaled up as much as possible but the CPU or memory usage still meets a compute scale-up condition, read replicas will be added.
If the compute has already been scaled down as much as possible but the CPU or memory usage still meets a compute scale-down condition, read replicas will be removed.
Billing
For details, see Serverless Billing.
Advantages
- Lower cost: TaurusDB serverless instances do not depend on other infrastructure or related services. They can be used right out of the box and provide stable and efficient data access services. You are only billed for the resources you use.
- Larger storage space: The storage space of a serverless instance can reach up to 32,000 GB. It can scale up if the data volume of the instance increases, avoiding impacts on workloads due to insufficient storage resources.
- Auto scaling of compute resources: Compute resources required for read and write operations can flexibly scale, greatly reducing O&M costs and system risks.
- Fully managed and O&M-free experience: All O&M tasks, such as specification scaling, storage autoscaling, monitoring and alarms, and intelligent O&M, are completed by Huawei Cloud professional teams, providing you with a truly O&M-free experience. You will not even notice, and your workloads will not be affected.
Use Cases
- Databases are infrequently used, such as for enterprise testing and individual developers.
- There are intermittent scheduled tasks to be executed, such as data statistics and archiving, school teaching, and R&D tasks.
- There are unpredictable fluctuations in workloads, such as check-in and edge computing.
- An O&M-free experience or fully managed database is required.
- Database costs need to be reduced during off-peak hours.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot