Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is NoSQL?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what is NoSQL". In daily operation, I believe many people have doubts about what is NoSQL. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what is NoSQL?" Next, please follow the editor to study!

NoSQL concept

With the rapid development of web2.0, non-relational and distributed data storage has developed rapidly, and they do not guarantee the ACID characteristics of relational data. The concept of NoSQL was put forward in 2009. The most common explanation for NoSQL is "non-relational", and "Not Only SQL" is also accepted by many people. The word "NoSQL" was first used as the name of a lightweight relational database in 1998. )

NoSQL is most used by us when key-value storage, of course, there are other document, column storage, schema database, xml database and so on. Before the concept of NoSQL was proposed, these databases were used in various systems, but they were rarely used in web Internet applications. Such as cdb, qdbm, bdb databases.

The bottleneck of traditional Relational Database

The traditional relational database has good performance, high stability, has been tested by history, and it is easy to use and powerful. At the same time, it has accumulated a large number of successful cases. In the field of the Internet, MySQL has become the absolute front king, it is no exaggeration to say that MySQL has made an outstanding contribution to the development of the Internet.

In the 1990s, the number of visits to a website was generally small and could be easily handled with a single database. At that time, there were more static web pages than dynamic interactive websites.

In the last 10 years, the website began to develop rapidly. Popular forums, blogs, sns and Weibo gradually lead the trend in the field of web. In the early days, the forum traffic is actually not large, if you contact the network earlier, you may still remember that there were text-based storage forum programs at that time, you can imagine the average forum traffic.

Memcached+MySQL

Later, with the increase in the number of visits, almost most websites using MySQL architecture began to have performance problems on the database. Web programs are no longer only focused on functionality, but also in pursuit of performance. Programmers begin to make extensive use of caching technology to ease the pressure on the database and optimize the structure and index of the database. At first, it is popular to ease the pressure on the database through file caching, but when the traffic continues to increase, multiple web machines cannot be shared through file caching, and a large number of small file caches also bring high IO pressure. At this time, Memcached naturally becomes a very fashionable technology product.

As an independent distributed cache server, Memcached provides a shared high-performance cache service for multiple web servers. On the Memcached server, it develops the expansion of multiple Memcached cache services according to the hash algorithm, and then appears consistent hash to solve the malpractice of a large number of cache invalidation caused by adding or reducing cache servers. At that time, if you went to the interview and you said you had Memcached experience, you would definitely get extra points.

Mysql master / slave read / write separation

Due to the increased write pressure on the database, Memcached can only alleviate the read pressure on the database. The concentration of read and write on a database makes the database unbearable. Most websites begin to use master-slave replication technology to achieve read-write separation, so as to improve read-write performance and read-library scalability. Mysql's master-slave mode has become standard for websites at this time.

Table and database

With the continued rapid development of web2.0, on the basis of Memcached cache, master-slave replication and read-write separation of MySQL, the write pressure of MySQL master library begins to appear bottleneck, and the amount of data continues to soar. Due to the use of table locks in MyISAM, there will be serious lock problems in high concurrency. A large number of highly concurrent MySQL applications begin to use InnoDB engine instead of MyISAM. At the same time, it has become popular to use sub-table and sub-database to alleviate the expansion problem of writing pressure and data growth. At this time, sub-table and sub-database has become a hot technology, which is not only a hot issue in the interview, but also a hot technical issue discussed in the industry. It was at this time that MySQL launched an unstable table partition, which brought hope to companies with average technical strength. Although MySQL launched the MySQL Cluster cluster, but because there are few successful cases in the Internet, the performance can not meet the requirements of the Internet, but provides a very great guarantee in high reliability.

Scalability bottleneck of MySQL

On the Internet, most MySQL should be IO-intensive. In fact, if your MySQL is CPU-intensive, it is likely that your MySQL design has performance problems and needs to be optimized. The development of MySQL applications in the environment of large amount of data and high concurrency is becoming more and more complex and technically challenging. It takes experience to grasp the rules of sub-table and sub-database. Although some technologically powerful companies like Taobao have developed a transparent middleware layer to shield the complexity of developers, it can not avoid the complexity of the entire architecture. The sub-libraries of sub-libraries and sub-tables are faced with the problem of expansion at a certain stage. There is also a change in requirements, which may require a new way of dividing libraries.

MySQL database often stores some large text fields, resulting in very large database tables, which is very slow when doing database recovery, and it is not easy to recover the database quickly. For example, text with a size of 10 million 4KB is close to the size of 40GB, and if you can omit this data from MySQL, MySQL will become very small.

Relational database is very powerful, but it can not cope with all application scenarios well. The scalability of MySQL is poor (complex technology is needed to implement it), the pressure of IO under big data is great, and it is difficult to change the table structure, which is exactly the problem faced by developers using MySQL at present.

Advantages of NOSQL

Easy to expand

There are many kinds of NoSQL databases, but a common feature is to remove the relational characteristics of relational databases. There is no relationship between the data, so it is very easy to extend. It also brings scalable capabilities at the architectural level.

Large amount of data, high performance

NoSQL databases have very high read and write performance, especially in the case of large amounts of data. This benefits from its non-relational nature and the simple structure of the database. Generally, Query Cache is used in MySQL, and Cache is invalid every time the table is updated. It is a kind of large-grained Cache. In applications with frequent interactions for web2.0, Cache performance is not high. NoSQL's Cache is record-level and is a fine-grained Cache, so NoSQL has much higher performance at this level.

Flexible data model

NoSQL does not need to establish fields for the data to be stored in advance, and can store custom data formats at any time. In a relational database, adding and deleting fields is a very troublesome thing. If it is a table with a very large amount of data, adding fields is a nightmare. This is especially true in the web2.0 era with a large amount of data.

High availability

NoSQL can easily implement a highly available architecture with little impact on performance. For example, the Cassandra,HBase model can also achieve high availability by copying the model.

At this point, the study of "what is NoSQL" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report