Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Introduction nosql
NoSQL: a class database (not only sql) emerging
- Refers to non-relational databases
- SQL syntax is not supported
- Traditional relational database structure stored in a table that is completely different, the data are stored in nosql form KV
- NoSQL world is not a universal language, each database has its own nosql api and grammar, as well as good business scene
- NoSQL considerable number of product categories: Redis.Mongodb.Hbase hadoop.Cassandra hadoop
NoSQL and SQL database comparison:
- Different application scenarios: sql database suitable for particularly complex relational data query scenarios, nosql and vice versa
- SML support of: sql support of things very well, but does not support basic things nosql
- Both continue to learn from each other, showing a trend of convergence
Redis Introduction
- Redis is an open source use written in ANSI C, support network, based on the persistence of memory can log type, Key-Value database, and provides multi-lingual API. From March 15, 2010, Redis development work was hosted by VMware. From May 2013 began, Redis development sponsored by Pivotal.
- Redis NoSQL technology is a camp, it needs to accommodate storage under different scenarios in a variety of key data types, with some of the high-level interface that can be qualified as different roles cache, queue system
Redis properties
Redis and other key - has the following three characteristics value caching products:
- Redis supports data persistence, data in memory can be saved to disk, reboot to load when you can be reused.
- Redis only supports simple key-value data types, while also providing a storage list, set, zset, hash and other data structures.
- Redis supports backup data, i.e., data backup master-slave mode.
Redis advantage
- High performance - Redis can read as fast as 110,000 times / s, write speed is 81000 times / s.
- Rich data types - Redis supports binary case Strings, Lists, Hashes, Sets and Ordered Sets the data type of the operation.
- Atom - Redis All operations are atomic.
- Feature-rich - Redis also supports publish / subscribe, notification, key expiration and so on characteristics.
Redis application scenarios
- Used for the cache (ehcache / memcached) - All data are redis stored in memory (memory database)
* can replace the traditional database in certain scenarios - Application of social class such as - In some large systems, skillfully achieve some specific features: session sharing, shopping cart
- You have a rich imagination, redis can be used in can give you lots of surprises .......