SQL and NoSQL-Integration of MySQL and NoSQL

Source: Internet
Author: User

The reason for writing this article is that MySQL5.6.2 suddenly launched the memcached function. The emergence of NoSQL to InnoDB with Memcached shows that NoSQL has indeed had a huge impact on relational databases. I personally think this is a huge improvement, allows developers to use NoSQL and relational databases more conveniently. NoSQL is generally considered to have higher performance than relational databases. Is it a better choice to provide NoSQL functions directly on InnoDB and coexist with MySQL?

MySQL with HandlerSocket

Last year, I saw the appearance of HandlerSocket on twitter and claimed that the performance was twice that of Memcached. It was amazing that it could reach Gb/s QPS. Then HandlerSocket became one of the focuses of the NoSQL field. A large number of people started to try and did some performance tests on their own. Is the structure of HandlerSocket:

 

Figure 1HandlerSocket structure is from the official website)

The appearance of HandlerSocket makes us feel bright. It turns out that InnoDB has good performance and can directly provide NoSQL functions. The biggest benefit is that you can share the functions of MySQL, which can be used by DBAs in the past. But there are some small risks:

• HandlerSocket is not released with MySQL, so it is unavailable to users who use the MyISAM engine. However, Percona-Server has now integrated HandlerSocket, which is very convenient to use.

• At present, there are not many success stories on a large scale, and only a small number of domestic companies are trying. I know the Apsara open platform, which is said to be good.

• The official test data is insufficient in application scenarios. At least the test scenarios differ greatly from our actual use cases. But there is no doubt that HandlerSocket performance is much more efficient than using MySQL directly.

InnoDB with Memcached

Perhaps because of the popularity of HandlerSocket, perhaps inspired by HandlerSocket, MySQL began to focus on applications in the NoSQL field, and added the function of directly accessing native Innodb APIs through Memcached protocol in MySQL 5.6.2.

InnoDB with Memcached provides the Memcached service in the same process that provides the MySQL service, which is almost the same as the architecture mode of HandlerSocket. Although InnoDB with Memcached is still a preview version, I personally prefer it because:

• It uses the Memcached protocol and supports both the text and binary protocols. It will win a lot in the choice and maturity of the client;

• The Three cache modes supported by Memcached not only save the trouble of using Memcached for data caching during development, but also provide better reliability and data consistency;

• In applications, you can use the efficient memcached protocol to operate data, and you can also use SQL to perform complex query operations;

Note: currently, update operations through memcached are not recorded in binlog, and will be supported in future versions.

 

Figure 2 InnoDB with Memcached

Memcached and MySQL Cluster

Obviously, we will think that MySQL Cluster combined with Memcached is a better combination. MySQL Cluster provides 99.999% high availability and truly provides decentralized seamless and high scalability. What is more exciting than this? MySQL has provided such a function.

 

Figure 3 NDB with Memcached

Although MySQL Cluster has the advantages of high reliability and seamless expansion, it cannot be satisfied with the efficiency of complex SQL queries. However, MySQL Cluster with Memcached is a good choice for massive data storage requirements that rely solely on key-value queries and writes.

Summary

Because Memcached is simple, lightweight, and has a large number of clients, Memcached-compatible products have inherent advantages.

MySQL provides the NoSQL function. I personally think that MySQL is not unable to withstand the loneliness, but is indeed responding to user needs. As mentioned in the previous article, "NoSQL is just a concept. It is not a database product. MySQL can also be a NoSQL product." Now, this is the answer. NoSQL restricts developers' architectures and development methods in terms of architecture to improve scalability and performance. The integration of NoSQL and MySQL also provides complex query functions.

Although MySQL provides the NoSQL function, if you want to try it, your database design must start from NoSQL and then consider the SQL query function.

The integration of SQL and NoSQL will indeed bring convenience to developers. For example, Mongodb, which is very popular recently, is the biggest attraction for development. It supports simple relational queries. The integration of SQL and NoSQL may be a trend of many database products in the future. However, the advantage of a pure NoSQL database is its simplicity, efficiency, and scalability.

This article has been launched on the InfoQ Chinese site and is copyrighted. The original Article is MySQL and NoSQL-Integration of SQL and NoSQL. If you need to reprint it, please attach this statement. Thank you.

InfoQ Chinese site is an online independent community for mid-and high-end technical personnel ,. NET, Ruby, SOA, agility, architecture and other fields to provide timely and in-depth information, high-end technology conferences such as QCon, offline technology exchange activities QClub, free mini book download such as architect, etc..

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.