Redis
Developer(s) | Salvatore Sanfilippo |
---|---|
Initial release | April 10, 2009 |
Stable release | 2.8.17
/ September 19, 2014 |
Repository | |
Written in | ANSI C |
Operating system | Cross-platform |
Available in | English |
Type | Key–value stores |
License | BSD |
Website | redis |
Redis is a data structure server. It is open-source, networked, in-memory, and stores keys with optional durability. The development of Redis has been sponsored by Pivotal Software since May 2013;[1] before that, it was sponsored by VMware.[2][3] According to the monthly ranking by DB-Engines.com, Redis is the most popular key-value store.[4] The name Redis means REmote DIctionary Server.[5]
Supported languages
Many languages have Redis bindings, including:[6] 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,[7] Ruby, Scala, Smalltalk and Tcl.
Data types
Redis maps keys to many types of values. A key difference between Redis and other structured storage systems is that Redis supports not only strings, but also abstract data types:
- 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 [8] 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.
By default, Redis syncs data to the disk at least every 2 seconds, with more or less robust options available if needed. In the case of a complete system failure on default settings, only a few seconds of data would be lost.[9]
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 can be configured to accept writes, 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.[10]
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.[11] There is no notable speed difference between write and read operations. Redis operates as a single process and single-threaded. Therefore a single Redis instance cannot utilize parallel execution of tasks e.g. stored procedures (Lua scripts).
Clustering
The Redis project has a cluster specification,[12] but the cluster feature is currently in Beta stage.[13] According to a news post by Redis creator Sanfilippo, the first production version of Redis cluster (planned for beta release at end of 2013),[14] will support automatic partitioning of the key space and hot resharding, but will support only single key operations.[15] In future Redis Cluster is planned to support up to 1000 nodes, fault tolerance with heartbeat and failure detection, incremental versioning (“epochs”) to prevent conflicts, slave election and promotion to master, and publish/subscribe between all cluster nodes.[12][13][16]
Cloud deployment
Redis is commonly deployed on IaaS or PaaS platforms like Amazon Web Services, Rackspace, or Heroku.
On IaaS platforms, it is possible to deploy Redis by uploading a virtual machine image, with Redis installed, to a cloud machine instance. Alternatively, it is possible to install Redis on an already-running machine instance.
- On Amazon EC2, Redis can be installed on a running machine instance using the script install-redis.sh.[17]
- On Windows Azure, Redis can be installed on a Centos Linux VM by following these instructions.[18]
- On Joyent, Redis can be installed using these instructions.[19]
On both IaaS and PaaS platforms, there are commercial database as a service providers which allow applications to use Redis as a managed service, without manually launching a virtual machine instance for the database. These services handle installation, configuration and maintenance of Redis on behalf of the application owner. Following are notable examples of commercial Redis database as a service providers.
Provider | Available On | Managed Service Features | Pricing Model |
---|---|---|---|
Amazon Web Services - ElastiCache[20] |
Amazon EC2 |
|
|
Morpheus - Redis as a service [23] | Morpheus |
|
|
RedisToGo[24] | Amazon EC2, Rackspace, Heroku, AppHarbor, Orchestra |
|
|
Redis Cloud (Redis Labs)[25] | Amazon EC2, Microsoft Azure, IBM SoftLayer, Google Cloud Platform, Heroku, Cloud Foundry, OpenShift, AppFog, AppHarbor |
|
|
ObjectRocket by Rackspace [27] | ObjectRocket |
|
|
See also
References
- ^ Redis Sponsors – Redis
- ^ VMware: the new Redis home
- ^ VMWare: The Console: VMware hires key developer for Redis
- ^ DB-Engines Ranking of Key-value Stores
- ^ http://redis.io/topics/faq
- ^ Redis language bindings
- ^ CRAN – Package rredis
- ^ Redis documentation "Virtual Memory", redis.io, accessed January 18, 2011.
- ^ Redis persistence demystified
- ^ ReplicationHowto – redis – A persistent key-value database with built-in net interface written in ANSI-C for Posix systems – Google Project Hosting
- ^ "FAQ".
- ^ a b Redis Cluster Specification, Redis.io, Retrieved 2013-12-25.
- ^ a b Redis Cluster Tutorial, Redis.io, Retrieved 2014-06-14.
- ^ Redis Download Page, Redis.io, Retrieved 2013-12-25.
- ^ News about Redis: 2.8 is shaping, I'm back on Cluster, Antirez Weblog - Salvatore Sanfilippo, Retrieved 2013-12-25.
- ^ Redis Cluster - a Pragmatic Approach to Distribution, Redis.io, Retrieved 2013-12-25.
- ^ "Install Redis.sh", GitHub Gist, Retrieved 2013-12-29.
- ^ "Running Redis on a CentOS Linux VM in Windows Azure", Thomas Conté's MSDN Weblog, Retrieved 2013-12-29.
- ^ "Install Redis On Joyent" Daniel Jackoway, Retrieved 2014-01-14.
- ^ "Amazon ElastiCache", Amazon Web Services, Retrieved 2013-12-29.
- ^ "Amazon ElastiCache Free Usage Tier", Amazon Web Services, Retrieved 2013-12-29.
- ^ "Amazon ElastiCache Pricing", Amazon Web Services, Retrieved 2013-12-29.
- ^ "SQL Authority Review", Retrieved 2014-08-11.
- ^ a b "RedisToGo Documentation", RedisToGo.com, Retrieved 2013-12-29.
- ^ Redis Cloud by Redis Labs, Redis-Cloud.com, Retrieved 2013-12-29.
- ^ "Redis Labs Pricing", RedisLabs.com, Retrieved 2013-12-29.
- ^ [1] Retrieved 2014-08-15.
- Jeremy Zawodny, Redis: Lightweight key/value Store That Goes the Extra Mile, Linux Magazine, August 31, 2009
- Isabel Drost and Jan Lehnard (29 October 2009), Happenings: NoSQL Conference, Berlin, The H. Slides for the Redis presentation. Summary.
- Billy Newport (IBM): "Evolving the Key/Value Programming Model to a Higher Level" Qcon Conference 2009 San Francisco.
- A Mishra: "Install and configure Redis on Centos/ Fedora server".