Initial Redis:
redis is a key-value storage system . And Memcached Similarly, it supports relatively more stored value type, comprising a string (string), List ( list ), SET (set), zset (sorted set - ordered set) and hash (hash type). These data types are supported push / pop, add / remove and on the intersection and union, and difference richer operation, and these operations are atomic. On this basis, redis support a variety of different ways of sorting. Like with memcached, in order to ensure efficiency, the data is cached in memory. Redis difference is periodically updated in the data written to disk or to modify the operation of writing additional log file, and on this basis realize the master-slave (master and slave) synchronization.
Redis features:
- Memory database, speed, and also supports persistent data, 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.
- Support Services
Redis advantages:
- 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, and atomic Redis supports several operations performed after the merger. (Affairs)
- Feature-rich - Redis also supports publish / subscribe, notification, key expiration and so on characteristics.
Redis and other key-value store What is the difference?
- Redis has a more complex data structure and provide atomic operations on them, which is different from the other databases evolutionary path. Meanwhile Redis data types are based on the basic data structure transparent to the programmer, without the need for additional abstraction.
- Redis running in memory, but can be persisted to disk, so that when the high-speed read and write memory tradeoffs different data sets because the data can not be greater than the amount of hardware memory. Another advantage of in-memory databases are, compared to the same complex data structures, operate in a very simple memory on the disk, so you can do a lot of internal Redis highly complex matter. Meanwhile, in terms of their compact disk format to generate additional way, because they do not require random access.