Reading guide
Tencent cloud The database provides visual operation and maintenance pages and the ability of automatic backup , Lower the threshold of database operation and maintenance . At the same time, cloud database also supports high availability architecture , Data security and service reliability are more guaranteed . In addition, some cloud database vendors also provide database auditing 、 Slow query analysis 、 Data retrieval and other capabilities , Greatly reduce the database operation and maintenance DBA The amount of work .
Our company CTO And technical director are from Tencent department , So we started with Tencent cloud Service for . Their cloud database provides visual operation and maintenance pages and the ability of automatic backup , Lower the threshold of database operation and maintenance . At the same time, cloud database also supports high availability architecture , Data security and service reliability are more guaranteed . In addition, some cloud database vendors also provide database auditing 、 Slow query analysis 、 Data retrieval and other capabilities , Greatly reduce the database operation and maintenance DBA The amount of work .
In fact, we don't have a special DBA, It's all about developing your own business , By outsourcing the reliability of the database to the cloud , It's really greatly reduced our workload , That's cool . But in the specific use process , Found that there are still some places not satisfied , such as MySQL The highest edition is only 5.6, You can't use it 5.7.8+ Newly added JSON Field ; The threshold of establishing the database is high ( Want the highest version );binlog Backup of is not convenient ; The hole in database Authorization ( No, FILE and SHUTDOWN jurisdiction , You can't grant all on \.\) etc. .
I remember comparing it before Alibaba cloud and UCloud Virtual machine disk of IO( At that time Tencent cloud It seems to have just started ), It's been so long , Let's have a look at it again , How about their cloud database . At present, only these three companies in China are relatively eye-catching , Netease and Baidu's jump first , I haven't heard of anyone using it . The other one X Let's forget the clouds , Companies where options can go black , I don't think it will last long .
This time, in addition to contrast performance , By the way, take a look at the price .
Take a shot before the test starts : The following tests may be rough , It's not about the actual business , So the results are for reference only , It only represents the author's own views and usage scenarios . And the actual business is not always based on performance , The company's whole set of business needs the support of a number of cloud services , The most basic host 、 database 、NoSQL、 Object storage 、 Load balancing and other services are more perfect , But it's adding value 、 There are advantages and disadvantages in additional services 、 Bright spot , The actual selection should be carefully considered according to the business characteristics .
performance
First and foremost , It is the read-write performance of cloud database . When I plan the configuration of an instance , The main considerations are as follows 2 spot :
- First , Cloud database should use SSD Hard disk , This can ensure that the database server's IO As soon as possible
- secondly , The memory of cloud database should be as large as possible , In this way, as much data as possible can be cached , Improve reading and writing speed
So the database configuration I chose is as follows : Hard disk 300GB SSD, Memory 8GB about . Because each cloud platform provides different configurations ( Tencent cloud The memory to disk ratio is limited ,UCloud There is no memory for 8G wait ), I applied for the following configuration of cloud database on three cloud platforms for performance test :
Because of the actual situation , Cloud databases are generally accessed through cloud servers , So I'm here 3 Each platform has applied for a virtual machine with similar configuration , Run performance tests on it . The operating system of the virtual machine I applied for is 64 position CentOS 6.5, The specific configuration is as follows :
Now the more popular test database tool is sysbench, In order to match the actual situation , I am right. sysbench The parameters have been modified .
Generally speaking , Reading is much more than writing , And there are many operations that require range lookup and sorting , So I increased the proportion of read operations in the test , In particular, it increases the proportion of range lookup and sorting .
meanwhile , For write operations , A little higher update The proportion of operations . Finally running the test , The ratio of read to write operations for each transaction is 6:1 about . In order to simulate the scene after the project starts , my sysbench The amount of data in the test set is total 20 A watch , Each table 200 Ten thousand rows of data , Turn on 32 Threads , Send transaction requests to the database in parallel , Run together 30 minute . Here's what I observed :
If you chart the test results, it's the result :
The result of this performance test is far beyond my expectation , although UCloud The database interface looks like Alibaba cloud and Tencent cloud It's more simple than that , The product introduction is also relatively simple , however , The performance advantage surprised me . Tell the truth , Before you test yourself , I didn't expect UCloud With such a big lead in performance . From the test results analysis ,UCloud Than Alibaba cloud High 422%, Than Tencent cloud High 297%. and , It's still here UCloud Cloud database memory is not as good as other 2 The result of a big family (UCloud:6G Memory , Alibaba cloud and Tencent cloud :8G Memory ).
This data makes me understand UCloud Of SSD Cloud database performance is very exciting , Need to know , This is that I haven't done any tuning , Out of the box configuration , It's completely in line with my cloud database “ Rapid deployment , Satisfactory performance ” The expectations of the .
Here is a screenshot of the test results , From top to bottom are UCloud Of UDB, Alibaba cloud RDS And Tencent CDB:
UCloud Of UDB
Alibaba cloud RDS
Tencent cloud CDB
Price
After seeing the performance , By the way, I analyzed the price , Looks like Alibaba cloud and UCloud The price is linear . Alibaba cloud According to memory ,CPU And disk pricing , and UCloud Based on memory and disk pricing ,CPU free . Tencent cloud There are only a few files in the configuration of , Each file is priced according to memory and disk , The arrangement of memory and disk is fixed , It's not a simple linear relationship . therefore , I figured out Alibaba cloud and UCloud The calculation constant of the price factor of , And then to Tencent cloud Based on the configuration of , It is calculated separately that 3 The price of each manufacturer under the same conditions , We can get the pricing trend chart of the three manufacturers as follows :
among , Tencent cloud The price is the cheapest , It's just that the ratio of disk to memory is fixed ;UCloud The price ratio of Tencent cloud A little expensive , and Alibaba cloud Higher than the other two 40% About the price . This may be because Alibaba cloud The relationship between the primary and secondary architectures ; however , I find UCloud The normal version of UDB And high availability UDB It's almost a price , in other words , If you consider the highly available cloud database of the primary and standby Architecture ,UCloud The price ratio of high availability version instances of Alibaba cloud Be low 40%. Take a close look at , Looks like UCloud The highly available database of has been on sale recently , That's why it's so cost-effective , That is to say, you can save a lot of money by buying during the event . Unfortunately, we use Tencent cloud ……
summary
Alibaba cloud The documentation is very complete , And detailed . A lot of information can be obtained through documentation . And it's MySQL Online management tools are powerful , It's more troublesome to set up a database , You still need to set up a database , The price is more expensive .
Tencent cloud Although there is no Alibaba cloud Of RDS So well done , It's easy to use . They use PHPMyAdmin To manage the database , It may be easier for developers who are familiar with the tool . It's cheaper .
UCloud Cloud database measured TPS and QPS Performance is much higher than the industry average . And the product is easy to use , The price is moderate .
in summary , Cloud database is the most cost-effective UCloud Of UDB.
One extra word , For one of the two things programmers hate the most “ Written document ”, In the view 3 When introducing the database products of several manufacturers , Feeling Alibaba cloud and Tencent cloud The product introduction of our company is very good , There are architectures for various solutions , Very intimate . And the difference between cloud database and cloud host self built database is also very intuitive ; and UCloud Of UDB The introduction is quite simple , It needs to be further improved .
This article only represents personal views , If you have comments and suggestions , Welcome to explore .
This paper addresses :http://www.linuxprobe.com/cloud-database-contrast.html[](http://www.linuxprobe.com/ngi...
Provide the latest for free Linux Technical course books , Strive to do more and better for open source technology enthusiasts :http://www.linuxprobe.com/thread