Redis (data store)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Developer(s) Salvatore Sanfilippo
Initial release 2009
Stable release 2.2.2 / March 4, 2011; 61 days ago (2011-03-04)
Development status Active
Written in ANSI C
Operating system Cross-platform
Available in English
Type Document-oriented database
License BSD

Redis is an open-source, networked, in-memory, persistent, journaled, key-value data store. It is written in ANSI C. Supported languages or language bindings include C, C++, C#, Clojure, Common Lisp, Erlang, Haskell, Java, JavaScript, Lua, Objective-C, Perl, PHP, Python, R, Ruby, Scala, Go, and Tcl. As of 15 March 2010, development of Redis is sponsored by VMware[1][2].



[edit] Data model

The Redis data model is - in its outer layer - a dictionary where keys are mapped to values. One of the main differences between Redis and other structured storage systems is that values are not limited to strings. In addition to strings, the following abstract data types are supported:

The type of a value determines what operations (called commands) are available for the value itself. Redis supports high level atomic server side operations like intersection, union, and difference between sets and sorting of lists, sets and sorted sets.

[edit] Persistence

Redis typically holds the whole dataset in RAM, but can also be configured to use virtual memory[3]. Persistence is reached in two different ways: One is called snapshotting, and is a semi-persistent durability mode where the dataset is asynchronously transferred from memory to disk from time to time. Since version 1.1 the safer alternative is an append-only file (a journal) that is written as operations modifying the dataset in memory are processed. Redis is able to rewrite the append-only file in the background in order to avoid an indefinite growth of the journal.

[edit] Replication

Redis supports master-slave replication. Data from any Redis server can replicate to any number of slaves. A slave may be a master to another slave. This allows Redis to implement a single-rooted replication tree. Redis slaves are writable, permitting intentional and unintentional inconsistency between instances. The Publish/Subscribe feature is fully implemented, so a client of a slave may SUBSCRIBE to a channel and receive a full feed of messages PUBLISHed to the master, anywhere up the replication tree. Replication is useful for read (but not write) scalability or data redundancy.[4]

[edit] Performance

The in-memory nature of Redis allows it to perform extremely well compared to database systems that write every change to disk before considering a transaction committed.[citation needed] There is no notable speed difference between write and read operations.[5]

[edit] See also

[edit] References

  1. ^ VMware: the new Redis home
  2. ^ VMWare: The Console: VMware hires key developer for Redis
  3. ^ Redis documentation "Virtual Memory",, accessed January 18, 2011.
  4. ^
  5. ^ A. Charnock: "Redis Benchmarking on Amazon EC2, Flexiscale, and Slicehost"

[edit] External links

Personal tools