In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what type of database redis is, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!
What is Redis?
Redis is a nosql (not only sql not only sql) database, which is translated into Chinese as a non-relational database.
What is nosql?
NoSQL, generally refers to non-relational database, NoSQL is Not-Only SQL, which can be used as a good supplement to relational database. With the rise of Internet web2.0 websites, non-relational databases have now become an extremely hot new field, and non-relational database products are developing rapidly. However, the traditional relational database has been unable to cope with web2.0 websites, especially the very large-scale and highly concurrent SNS type web2.0 pure dynamic websites, which has exposed many insurmountable problems, such as:
1. High performance-the requirement for high concurrent read and write of database
Web2.0 website needs to generate dynamic pages and provide dynamic information in real time according to users' personalized information, so it is basically impossible to use dynamic page static technology, so the concurrent load of database is very high, often reaching tens of thousands of read and write requests per second. Relational database can barely cope with tens of thousands of SQL queries, but the hard disk IO can no longer handle tens of thousands of SQL write data requests. In fact, for ordinary BBS sites, there is often a demand for high concurrent write requests, such as real-time statistics of online user status, recording the number of clicks on popular posts, voting count and so on, so this is a very common demand.
2. Huge Storage-the need for efficient storage and access of massive data
SNS sites like Facebook,twitter,Friendfeed generate a large amount of user dynamics every day. Take Friendfeed as an example, there are 250 million user dynamics in a month. For relational databases, it is extremely inefficient and even unbearable to query SQL in a table of 250 million records. For example, the user login system of large web websites, such as Tencent, Shanda, often has hundreds of millions of accounts, and the relational database is also very difficult to deal with.
3. High Scalability & & High Availability- 's requirements for high scalability and high availability of the database
In the web-based architecture, the database is the most difficult to scale out. When the number of users and visitors of an application system is increasing day by day, your database has no way to expand the performance and load capacity as easily as web server and app server by adding more hardware and service nodes. For many websites that need to provide 24-hour uninterrupted service, it is very painful to upgrade and expand the database system, which often requires downtime maintenance and data migration. why can't the database be expanded by constantly adding server nodes?
The emergence of NoSQL database is to solve the challenges brought by large-scale data collection and multiple data types, especially the application problem of big data.
II. Four categories of NoSQL databases
Key value (Key-Value) storage database
Related products: Tokyo Cabinet/Tyrant, Redis, Voldemort, Berkeley DB typical applications: content caching, mainly used to deal with the high access load of a large amount of data. Data model: a series of key-value pairs advantages: fast query disadvantages: stored data lack of structured column storage database
Related products: Cassandra, HBase, Riak typical applications: distributed file system data model: column cluster storage, the same column of data together advantages: fast search speed, strong scalability, easier distributed expansion disadvantages: function is relatively limited
Document database
Related products: CouchDB, MongoDB typical applications: Web applications (similar to Key-Value, Value is structured) data model: a series of key-value pairs advantages: data structure requirements are not strict disadvantages: query performance is not high, and lack of uniform query syntax
Graphics (Graph) database
Related databases: Neo4J, InfoGrid, Infinite Graph typical applications: social network data model: graph structure advantage: using graph structure correlation algorithm. Disadvantages: need to calculate the whole diagram to get the results, it is not easy to do a distributed cluster solution.
III. Redis Foundation
Redis stores data in memory. Redis is widely used in Internet projects because of its fast content access speed. Redis has the advantages of fast access speed. Officials say that the read speed will reach 300000 times per second, and the write speed will be about 100000 times per second, which is specifically limited to hardware.
Disadvantages: support for persistence is not good enough.
Therefore, redis is generally not stored as the main database of data, but is generally used with traditional relational databases.
Redis is an open source high performance key-value pair (key-value) database developed in C language. It meets the storage needs in different scenarios by providing a variety of key data types. So far, Redis supports the following key data types:
String type hash type list type collection type
Fourth, the application scenario of redis
Caching (data queries, short links, news content, commodity content, etc.). (most commonly used) session separation in a distributed cluster architecture. A list of online friends in chat rooms. Task queue. (second kill, snap-up, 12306, etc.) app ranking. Website visit statistics. Data expiration processing (can be accurate to milliseconds)
The above is what kind of database redis is all the content, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.