Jump to content

Redis

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Ebr.wolff (talk | contribs) at 08:12, 15 August 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Redis
Developer(s)Salvatore Sanfilippo
Initial releaseApril 10, 2009 (2009-04-10)
Stable release
2.6.14 / June 20, 2013 (2013-06-20)
Repository
Written inANSI C
Operating systemCross-platform
Available inEnglish
TypeDocument-oriented database
LicenseBSD
Websiteredis.io

Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C. The development of Redis is sponsored by Pivotal.[1][2] According to the monthly ranking by DB-Engines.com, Redis is the most popular key-value store.[3]

Supported languages

Many languages have Redis bindings, including:[4]

ActionScript, C, C++, C#, Clojure, Common Lisp, Dart, Erlang, Go, Haskell, Haxe, Io, Java, JavaScript (Node.js), Lua, Objective-C, Perl, PHP, Pure Data, Python, R,[5] Ruby, Scala, Smalltalk and Tcl.

Data models

In its outer layer, the Redis data model is 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:

  • Lists of strings
  • Sets of strings (collections of non-repeating unsorted elements)
  • Sorted sets of strings (collections of non-repeating elements ordered by a floating-point number called score)
  • Hashes where keys and values are strings

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.

Persistence

Redis typically holds the whole dataset in memory. Versions up to 2.4 could be configured to use what they refer to as virtual memory (not to be confused with the memory-management technique virtual memory),[6] in which some of the dataset is stored on disk, but this feature is deprecated. Persistence is now 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, written in RDB dump format. Since version 1.1 the safer alternative is AOF, 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.

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.[7]

Performance

When the durability of data is not needed, 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.[8] There is no notable speed difference between write and read operations.

Companies that use Redis

Template:Multicol

Template:Multicol-break

Template:Multicol-break

Template:Multicol-end

See also

References

  1. ^ VMware: the new Redis home
  2. ^ VMWare: The Console: VMware hires key developer for Redis
  3. ^ DB-Engines Ranking of Key-value Stores
  4. ^ Redis language bindings
  5. ^ CRAN - Package rredis
  6. ^ Redis documentation "Virtual Memory", redis.io, accessed January 18, 2011.
  7. ^ ReplicationHowto - redis - A persistent key-value database with built-in net interface written in ANSI-C for Posix systems - Google Project Hosting
  8. ^ "FAQ".