< A;. About NoSQL:
NoSQL is the abbreviation of Not-only-sql, is designed to replace the traditional relational database in some areas of use, especially for the web2.0 site and large SNS site, to meet the high concurrency, big Data application needs. The common NoSQL database system has hbase ( Hadoop database, based on Columnstore), MongoDB (document database, with type and JSON Bson syntax to store records), redis/memcached (key value store database) and other types.
< two;. Introduction to Redis:
Redis is the Nosqlogic series database, and memcached the most similar database system, the same genus of key-value storage systems. Strictly speaking, memcached does not count as a database system, it can only be counted as an intermediate cache system, because it cannot persist data storage. Redis literally means: Remote dictionary server (remotely DIctionary server), compared with memcached, provides a richer data type and is considered a data structure service.
< three;. Redis, memcached comparison:
The advantages of Redis are obvious compared to memcached.
1. Data type: Redis supports richer data types, including strings (string), lists (list: Available as queues, stacks), collections (set: Operations that can be set), ordered collections (sorted set), hash tables (hash), etc. and memcached only supports strings.
2. Object size: Redis supports up to 1GB of object size, while memcached is only 1MB, it is necessary to use Redis to replace memcached.
3. Sharding (sharding): Data can be stored discretely on different physical machines to overcome the memory size limit of a single machine. Memcached is implemented in the server implementation of sharding, and Redis needs to use Jedis to implement client-side sharding, Jedis is the official Redis recommended access to Redis using Java way.
Using the Jedis shard mechanism, a batch of data is stored and different portions of the data are stored on different Redis servers. And that's not the difference for clients, but completely transparent. It is also important to note that support for shards is not provided when using spring Data Redis for client operations.
4. Persistence: Redis is able to persist data added to memory to disk, while memcached can only act as a cache middleware role with relatively limited functionality.
< four;. Application Scenarios:
1. Database server: Data that is used to store relatively simple structures.
2. Cache system: Cache data that requires a large amount of read and small modifications.
3. Build a real-time messaging system: Take advantage of the Publish (PUB)/subscribe (SUB) feature.
4. Support for queues: A list-based implementation queue, stack.
redis-Introduction and comparison