MySQL and nosql-Integration of SQL and nosql

Source: Internet
Author: User
Tags mongodb sql database sharding

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 1 handlersocket structure diagram (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 users who use the MyISAM engine cannot. 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 not sufficient in the Application Scenario. At least the test scenario is very different from the actual use scenario. 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 the ApplicationProgramYou can use the efficient memcached protocol to operate data, or 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's more exciting than that.

MySQL has provided such a function,Source codeHere. Here is a PPT demonstration of the o'reilly MySQL Conference. You can also read a blog of this function developer.

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. Before meArticleI also said that "nosql is just a concept, not a database product, and MySQL can also be nosql". Now, we have taken this sentence into consideration. 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.

Reference link:

    • MongoDB SQL support
    • Table support for tokyocabinet
    • Schema-free vs nosql
    • MySQL cluster-nosql access with some SQL
    • My Sina Weibo @ sunli1223nosql micro-group

About the author

Sun Li is currently a senior System Architect at qunar.com. He once worked for Phoenix, ku6, and Sohu. Years of Internet experience and program development, development of distributed search engines, high concurrency, big data website system architecture optimization, high availability, scalability, distributed system cache, database sharding) have rich experience in O & M monitoring and automatic O & M control. Is the author of phplock and phpbuffer, an open-source project. Recently, I developed a nosql database storage inetdb, which is a nosql database enthusiast.

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 high-end technical staffCommunity, For Java ,. 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.