| CARVIEW |
|
|
Activity:
High
|
|
Code license: New BSD License |
|
Labels: redis, KeyValue, AnsiC, database, networking, persistent, lists, sets, atomic, memcached, Posix, GPL, dictionary, hashTable |
Featured downloads:
redis-1.2.6.tar.gz
redis-2.0.3.tar.gzShow all » |
| Blogs: Twitter updates |
| Feeds: Project feeds |
| Groups: Redis DB dev and usage |
|
Owners: antirez |
| Contributors: simonwillisonnet, michelan...@altamore.org, anibalrojas, pcnoordhuis, ardsrk, Michael.S.Klishin, damian.janowski, soveran, michaelrbernstein |
| People details » |
Redis 2.0.0 Stable is out!, Redis 2.0 is a major new version of Redis, with tons of new features, more speed, new data types, and less memory used. You can find a raw list of what is new reading the Redis 2.0.0 Changelog page.
Not sure about what version of Redis you should use (1.2.x, 2.0.x, Redis master)? Read the Redis Status Page.
Redis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All this data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth. Redis supports different kind of sorting abilities.
In order to be very fast but at the same time persistent the whole dataset is taken in memory, and from time to time saved on disc asynchronously (semi persistent mode) or alternatively every change is written into an append only file (fully persistent mode). Redis is able to rebuild the append only file in background when it gets too big.
Redis supports trivial to setup master-slave replication, with very fast non-blocking first synchronization, auto reconnection on net split, and so forth.
Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, Mac OS X, Solaris, and so on. Redis is free software released under the very liberal BSD license. Redis is reported to compile and work under WIN32 if compiled with Cygwin, but there is no official support for Windows currently.
All the new work on Redis is sponsored by:
Past Redis work was sponsored by: (See the Sponsorship History for a list of all the sponsors)
Beyond the key-value model¶
It is possible to think at Redis as a data structures server, it is not just another key-value DB, see all the commands supported by Redis to get the first feeling. Redis supports operations like atomic push and pop of elements on lists, taking ranges of elements from this lists at once, trimming of lists, server-side intersections of sets and even sorting data! To show our points we wrote a simple Twitter clone with PHP + Redis: it's a very simple but still a real world example of web application, the article explains step by step how to write scalable applications with Redis.
Supported languages¶
(Please make sure to also check the more specific Supported Languages section of the documentation. But it's currently a draft so the "master" list is the following).
- Ruby main repository written by Ezra Zygmuntowicz (aka ezmobius). This client is now mainly developed by Michel Martens and Damian Janowski.
- Ruby Event Machine em-redis, written by Jonathan Broad.
- Python main repository originally written by Ludovico Magnocavallo (aka ludo), currently developed by Andy McCurdy.
- Twisted Python pypi link, thanks to Dorian Raymer.
- PHP Predis is a new, flexible and feature-complete PHP library client written by Daniele Alessandri (@jol1hahn). Predis is currently a work-in-progress and it targets PHP >= 5.3, though it is highly due to be backported to PHP >= 5.2.6 as soon as the public API and the internal design on the main branch will be considered stable enough, but you should give it a try as it already the best client library available for PHP.
- PHP Rediska is a full-featured pure PHP Redis client implementation supporting an impressive number of features: multiple servers, consistent hashing (with support for user-specified algorithm), abstraction of Redis types as PHP types, Zend framework integration. Rediska is developed by Ivan Shumkov and Maxim Ivanov.
- PHP redis.php is the legacy original PHP client written by Ludovico Magnocavallo (aka ludo), modified and ported to PHP 5 by Salvatore Sanfilippo, still not a good pick but there is still code running against it.
- PHP client lib written in C, as a PHP module: PHPRedis! thanks to Alfonso Jimenez for the initial implementation and to Nicolas Favre-Félix and Nasreddine Bouafif for bringing the code to a real-world usability level fixing a lot of bugs and implementing many additional commands.
- Erlang Erldis new repository (original one less updated is here) originally written by Valentino Volonghi of Adroll, the new updated fork is developed by Jacob Perkins.
- Tcl (the official version is included in the Redis tarball since it's maintained by myself, now you can find it in the Git repository).
- Perl bindings for Redis are available in this SVN repository thanks to Dobrica Pavlinusic.
- Lua bindings for Redis are available in this git repository (and as well as in the Redis git) thanks to Daniele Alessandri.
- Java has two client libraries projects: JDBC-Redis that as you can guess from the name is a client implementing the JDBC API, and JRedis that is JCA compliant. Both libs are actively developed and good quality, I suggest you to check both. Also note that JRedis plans to release support for asynchronous communication between the client and Redis.
- Java new client library project Jedis developed by Jonathan Leibiusky (aka xetorthio).
- Scala bindings for Redis are available in this Git repository, thanks to Alejandro Crosa.
- Clojure bindings for Redis: redis-clojure thanks to Ragnar Dahlén.
- C# bindings for Redis, Service Stack Redis, this client is based on the original C# client written by Miguel De Icaza but is actively developed and documented by Demis Bellot that is doing a great work! It's the way to go for C# Redis users.
- C# bindings for Redis: redis-sharp developed by Miguel De Icaza (what do you want more? ;).
- C bindings for Redis: Hiredis is a minimalistic C client lib for Redis giving just a simple layer to use Redis from C. Developed by myself (antirez) and Pieter Noordhuis.
- C bindings for Redis are finally available: Credis thanks to Jonas Romfelt. There is also a win32 port of Credis thanks to @BigThingist.
- C++ client for Redis, forked from original Brian Hammonds client, now developed by Ludger Sprenker redis-cplusplus-client. Support for sharding (with optional user provided algorithm), higher level API, based on standard library types and Boost.
- Javascript / Node.js bindings for Redis: redis-node-client thanks to Brian Hammond (@fictorial).
- Javascript / Node.js new client for node by Matt Ranney: node_redis. Reported to be very fast. Support for nested multi bulk replies.
- IO language bindings: iodis thanks to Harry Vangberg.
- Haskell bindings: redis haskell bindings thanks to Alexander Bogdanov. This is pretty complete with support for Hashes, Pub/Sub and so forth.
- Go Language bindings Redis Go thanks to Michael Hoisie.
- Common Lisp bindings cl-redis, thanks to vseloved@gmail.com].
- SmallTalk binidings for Squeak and Pharo SmallTalk Redis Client thanks to Mike Hales.
Also there are other Redis related projects that are not library clients:
- Ohm Object-hash mapping library for Redis, a Ruby library for storing objects in Redis, a persistent key-value database. It includes an extensible list of validations and has very good performance.
- Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks written by Luca Guidi
- A datamapper adapter for Redis written by Whoahbot.
- GORM for Redis by Graeme Rocher. GORM allows Grails developers used to the convenience of features such as dynamic finders, criteria and named queries to take advantage of Redis as their underlying store instead of Hibernate.
Speed¶
Redis is pretty fast!, 110000 SETs/second, 81000 GETs/second in an entry level Linux box. Check the benchmarks.
Sharding¶
Redis supports client-side sharding via consistent hashing. Currently there is no support for fail tolerance nor to add or remove clusters at run time.
The Redis Cluster project is going to be our next priority after the release of Redis 2.0.0. Redis Cluster is an higher level layer implemented as a different decoupled component using normal Redis instances as "Data Nodes". Redis Cluster will support adding and removing nodes while the system is running and fault tolerance.
Currently if you use Redis as cache the best thing to do is to use client support for consistent hashing. When using Redis as data store you can perform application level sharding, for instance moving different users in different Redis instances, or vertical sharding moving different kind of objects in different Redis instances.
Learn more!¶
- Wiki documentation: We have quite a bit of documentation, take a look.
- Twitter:
to get fresh information about the development of Redis you can follow @antirez on twitter. - IRC: It's possible to chat with Redis users and developers joining the #redis (irc.freenode.org) IRC channel.
- Join the Redis Google Group: The Redis Google Group is pretty alive with many people following and contributing discussions about Redis data set design problems, client lib implementation, and future developments.
The IRC channel and the Group are the best places to discuss about the design of your application using Redis. How to organize data to get the best performances and memory usage.
Programming examples¶
- Retwis is a PHP+Retwis twitter clone. Live demo, article explaining it design. The code is in the Downloads tab.
- Retwis-rb is a port of Retwis to Ruby and Sinatra written by Daniel Lucraft! With full source code included of course, the git repository is linked at the end of the Retwis-RB page.
- A very simple example of Ruby+Redis app using Sinatra. It's a note taking example developed by Pieter Noordhuis
Replication Quick Start¶
By default you can run Redis without a config file. For replication, at least in the slave, you need to load one. Just use ./redis-server redis.conf. All you have to do to make a Redis instance a slave of some other Redis server is to uncomment the slaveof <hostname> <port> line in the config file and re-run the slave. The two servers will sync and you can ask for the same queries in both to check the slave is actually a copy of the master. Learn more about replication...
Who is using Redis?¶
- Engine Yard
- Github
- Craigslist
- The Guardian (check this article).
- Superfeedr (details).
- Vidiowiki
- Wish Internet Consulting
- Ruby Minds
- Boxcar iphone application for push notifications.
- Zoombu is using Redis in our multi-modal travel search engine.
- LLOOGG real time stats site.
- Dark Curse using it for sessions and storing death counts.
- Virgilio Film (Italian movies community)
- OKNOtizie, the biggest Italian social news site
This is a very incomplete list, at this stage Redis is used by many companies.
If you use Redis in your startup drop me an email or tweet me @antirez and get listed here.
Road map¶
Please check the TODO file.

