Redis database understanding _NoSQL

NoSQL databases

Redis is written in C using a key-value open source NOSQL storage systems. (MySQL is different from the two-dimensional table stored in the form).
NoSQL:

  1. no sql no SQL (sql queries are not supported)
  2. not only sql is not the only SQL

redis official website address:
Redis official
Chinese website
Redis Chinese official
NoSQL application scenarios

  • Concurrent reading and writing of data with a high
  • High data scalability
  • Fast enough to quickly access data
  1. Take the latest N data operations
    such as the latest articles latest order takes the typical website, some electricity supplier.
  2. The chart application, TOP N fetch operation
    after the elapse of the first N sorted like. Comments such as the top 10 articles, most of the order amount before 15 orders.
  3. The need to set precise time expired scenes
    micro message recall feature, may be withdrawn within two minutes, two minutes after the expired can not be withdrawn. Red micro-channel 24 hours did not receive i.e. expired.
  4. Application of the counter
    Redis commands are atomic in nature, can easily be constructed counter for counting the number of system utilization INCR, DECR command.
  5. Uniq operation, a period of time such that all data acquired weighting value
    applied to all the data within a certain period of time to weight. For example, UV calculation of the number of sites.
  6. Pub / Sub build real-time messaging system
    of Redis Pub / Sub system can build a real-time messaging systems, such as many examples of systems with real-time chat Pub / Sub constructed.
  7. Cache data (hot data is cached)
    cache the latest, hottest, most common user data.
  8. Construction of the queue system

Interpretation of thermal data: data are often used to access data for the frequency higher thermal data
Example: When school bag similar to Nosql database, frequently used books, thermal data is
not applicable scene

  • Need transaction support
  • Sql structured query based storage, handling complex relationships requires ad hoc queries (user-defined query to the query).

For example NoSQL database

  1. memcache introduce
    NoSql database data occur very early in memory, generally do not support persistence simple key-value mode is generally used as an auxiliary cache database persistence database
  2. redis introduced
    almost covering most of the functionality of the Memcached data in memory, support for persistence, mainly used for backup and recovery support in addition to simple key-value mode, also supports a variety of data storage structures, such as list, set, hash , zset and so on. Generally as an auxiliary cache database persistence database
    is now available in the market with very much an in-memory database
  3. mongoDB introduction
    of high-performance, open source, free mode (schema free) document database data in memory, if enough memory to save data to the hard disk is not commonly used, although key-value model, but to value (in particular json) It provides a rich query capabilities to support large object binary data and can replace RDBMS (relational database management system) based on the characteristics of the data, an independent database. Or with RDBMS, storing specific data.
  4. Introduction columnar storage HBase
    HBase is the Hadoop project database. It requires a large number of random data, the real-time scene in the read and write operations. HBase goal is to deal with very large amount of data tables, can be more than one billion rows of data with ordinary computer processing, but also processing several million rows of data table of elements.

redis features

  • Efficiency: 110,000 speed is read Redis times / s, write speed is 81000 times / s
  • Atomicity: All operations are atomic Redis, while Redis also supports the full implementation of atomic and several operations.
  • It supports a variety of data structures: string (string); List (list); the hash (hash), set (set); zset (ordered set)
  • Stability: persistence, master-slave replication (cluster)
  • Other features: support expiration time, support services, message subscription.
Published 73 original articles · won praise 153 · views 60000 +

Guess you like

Origin blog.csdn.net/weixin_45737446/article/details/104914287