Introducing the features and useful functions you should know when considering using Alibaba Cloud ApsaraDB for PolarDB
My name is Teraoka and I am an infrastructure engineer.
This time we will talk about a certain service of Alibaba Cloud.
Alibaba Cloud begins offering new services in Japan including cloud DB “ApsaraDB for PolarDB”
Alibaba Cloud announced on the 20th that it will start offering the relational database ``ApsaraDB for PolarDB'' in Japan on its public cloud ``Alibaba Cloud.''
Have you finally come? . .
So this time, I would like to make full use of PolarDB in the Japan region, so
I would like to introduce some useful functions when actually using it as a database for services!
What is ApsaraDB for PolarDB?
As a prerequisite, I would like to briefly touch on PolarDB.
PolarDB is a managed relational database service compatible with MySQL, PostgreSQL, and Oracle.
It is touted as the next generation managed distributed RDS developed by Alibaba and
is capable of demonstrating high performance and cost performance.
As you can see by actually using it, it
is designed with AWS's Aurora in mind as a competitor to other companies' clouds
, and in Intel's tests, QPS improved by about 1.3 times compared to "Amazon Aurora".
The result seems to be that the 95th percentile latency (delay) is improved by about 1.8 times . *1
When you are aware of Aurora, you are concerned about its features and differentiation.
I would like to summarize them in a comparative form.
Features of PolarDB and differences from Aurora
architecture
Both PolarDB and Aurora are called distributed relational database services.
The following is an architecture diagram of PolerDB, which can be roughly divided into four concepts. *2
Cluster
It is like a logical group of one Primary Node and N Read-Only Nodes, and a
DNS record called a cluster endpoint is automatically allocated to the cluster when it is created.
By accessing this endpoint, you can issue SQL to the DB.
PolarDB's endpoints also support read/write separation.※3
- Write request: Send to Primary Node
- Read requests: sent to primary node or read-only node depending on each node's load
It automatically determines the node to connect to internally.
Aurora has separate endpoints for writing and reading, but
PolarDB only has one endpoint and is distributed appropriately internally, which is convenient.
Primary Node
This is the only node in a cluster that can perform both writing and reading.
Write requests to the DB are basically executed to this node.
Aurora has a multi-master function and can use multiple Primary Nodes, but
PolarDB does not have that function, so it is currently not possible to distribute write requests to multiple nodes.
Read-Only Node
These are read-only nodes that can be started up to 15 in a cluster.
Although it is possible to increase or decrease it manually, by using DAS (Database Autonomous Service),
it is possible to scale in/out according to the load situation. *4
It has the AutoScall function + can be activated on up to 15 devices, which is the same as Aurora, so
you can see that they are very conscious of the functionality.
Chunk Server
For both PolarDB and Aurora, the computing processing and storage processing of each node are completely separated.
The Chunk Server is responsible for storage processing in PolarDB.
DB data is stored in this Chunk Server, and
the storage capacity can be automatically scaled up or down according to the data capacity.
Storage autoscaling is also available in Aurora, but the maximum expansion capacity is different:
Aurora has a maximum expansion capacity of 64TB, while PolarDB can expand up to 100TB.
Useful functions of PolarDB
I would like to introduce some functions that I have actually used and found useful.
Data migration support by DTS
There is no need to consider this when using PolarDB for the first time, but
if you want to switch from an existing database service, you will need to consider the following.
- How to migrate existing DB data
- How to reduce downtime when switching to PolarDB
In times like these, PolarDB allows you to use DTS (Data Transmission Service), so
I think it's great that there is a way to migrate data. *5
Online scale up/down
PolarDB can be scaled up and down while it is online.
In the case of Aurora, it is necessary to temporarily stop nodes, so this is probably the most differentiating feature.
I was concerned about downtime when changing specifications, so I created a test DB like the one below.
CERATE DATABASE TEST; CREATE TABLE test ( column int(10) DEFAULT NULL ) ENGINE=InnoDB;
I checked by issuing an update every second when changing the specs.
update test set column=unix_timestamp();
A message appears on the console stating that the connection will be unavailable for up to 30 seconds, but
in reality, the total time it took to complete the change was 10 minutes, of which a connection error occurred for about 10 seconds.
On the other hand, with Aurora, it is necessary to stop the node when changing the specs,
resulting in approximately 5 to 10 minutes of downtime.
To avoid this, a common practice in Aurora is
to select the desired specs, add a new read-only node, and
manually failover that node to promote it to a write node to minimize
downtime. The response is often to suppress it.
Even if you use failover, it takes more than 10 seconds, so
I think PolarDB is definitely faster.
It seems like you can have the option of allowing downtime for about 10 seconds!
Enhancement of monitoring items
PolarDB has a rich
*6 It's great because you can check not only resources such as CPU but also performance metrics around InnoDB.
For Aurora, you can see similar metrics in Performance Insights, but at an additional cost.
PolarDB is not listed on *7
You can also set alerts using CloudMonitor.
Actually, CloudMonitor is also available for free, which is great. . . !
summary
This time, I introduced the features and useful functions of PolarDB from an operational perspective.
Although the actual construction steps are not included in this article,
it is necessary to understand the features and functions when using PolarDB for a new project or switching from another RDB, so please
use PolarDB. I would be happy if I could help those who are considering it.
Also, I would like to keep an eye on future updates of PolarDB.
source
*1 https://www.intel.com/content/www/us/en/products/docs/storage/alibaba-cloud-polardb-solution-brief.html
*2 https://www.sbcloud.co.jp /entry/sol/polardb/
*3 https://www.alibabacloud.com/help/ja/doc-detail/68510.htm
*4 https://www.alibabacloud.com/help/doc-detail/169686. htm
*5 https://jp.alibabacloud.com/product/data-transmission-service
*6 https://www.alibabacloud.com/help/ja/doc-detail/68555.htm
*7 https://www .alibabacloud.com/help/ja/doc-detail/68498.htm