Redis is a famous caching layer and in-memory database that is used in a lot of large-scale projects. Redis is used by Twitter GitHub, Pinterest, Snapchat, StackOverflow and Flickr.
It supports data structures such as strings, hashes, lists, sets, sorted sets, bitmaps and geospatial indexes with radius queries.
Some common usage scenarios can be found here
Whether you are using Ubuntu or Centos on your machine/server , these steps should help you install Redis.
In the terminal run the following statements :
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make
Make sure that your make was sucessfull by running
make test inside the terminal
You now have access to :
- redis-server is the Redis Server itself.
- redis-sentinel is the Redis Sentinel executable (monitoring and failover).
- redis-cli is the command line interface utility to talk with Redis.
- redis-benchmark is used to check Redis performances.
- redis-check-aof and redis-check-dump are useful in the rare event of corrupted data files.
make install to put the Redis server and cli to their proper locations.
Now you can run redis-server now to get the server up and running.
$ redis-server  01 Aug 19:29:28 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'  01 Aug 19:29:28 * Server started, Redis version 2.2.12  01 Aug 19:29:28 * The server is now ready to accept connections on port 6379
Check if Redis is working
$ redis-cli redis 127.0.0.1:6379> ping PONG redis 127.0.0.1:6379> set mykey somevalue OK redis 127.0.0.1:6379> get mykey "somevalue"
Getting the right driver/client
For each language there may be a client for dealing with Redis. You can find the full list from here
In the next post , I will try to provide more details about using Redis from Java and more details about Redis itself. Thanks a lot for reading !
Subscribe to Learn With Passion
Get the latest posts delivered right to your inbox