Image for post: Getting started with Redis

Getting started with Redis

From redis.io: "Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker". To scale an application can be a big problem and using the right tools can make the difference. Redis is excellent and many big companies are choosing it. Let's see how to use it in practice.

Download and installation

You can download Redis or install it on your Linux computer (you don't need to install it on Kali Linux 2). First install new dependencies:

sudo apt-get updatesudo apt-get install build-essentialsudo apt-get install tcl8.5

Install Redis server with apt-get:

sudo apt-get install redis-server

Manual install:

wget http://download.redis.io/releases/redis-stable.tar.gztar xzf redis-stable.tar.gzcd redis-stablemakemake testsudo make installcd utilssudo ./install_server.sh

Edit the config file:

sudo nano /etc/redis/redis.conf

Understanding Redis

Type redis-server and you will run the service. Leave the CLI opened. Type CTRL+C to stop the service.

Using Redis on Heroku

You are using Redis on your computer but you want to try Redis online without spending money. Heroku is maybe the best solutions. Check out this links:

As you can see Heroku is excellent and it offers an easy support for common programming languages like Java, Python, Ruby and PHP.

Books

You can find many chat tutorials with Redis directly online, for example, but a book can be useful if we want to understand Redis and go deep to many details. I can suggest these 2 books, both from Packt publishing:

  • Learning Redis
  • Redis Essentials

The next step

It can be very interesting to see how you  can use Redis and combine it with a programming language to improve performances or build a real time web application. It depends on what you need. Happy coding!

Tags