redis

Installation and Setup

Installing Redis

wget https://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make

Starting Redis

redis-server

Check if Redis is working

redis-cli ping

This should return PONG

Access Redis Cli

Assuming that you are running redis server on localhost you can type command

redis-cli

After this command appear redis command line prompt

127.0.0.1:6379>

Redis data types

The following is the list of all the data structures supported by Redis:

  • Binary-safe strings
  • Lists: collections of string elements sorted according to the order of insertion.
  • Sets: collections of unique, unsorted string elements.
  • Sorted sets: similar to Sets but where every string element is associated to a floating number value, called score.
  • Hashes: are maps composed of fields associated with values.
  • HyperLogLogs: this is a probabilistic data structure which is used in order to estimate the cardinality of a set.

Based on redis.io official documentation

Installing and running Redis Server on Windows

Note: The Redis project does not officially support Windows.

However, the Microsoft Open Tech group develops and maintains this Windows port targeting Win64. Official redis.io/download

You can choose to download different versions or the latest version of Redis github.com/MSOpenTech/redis/releases

  1. Download either .msi or .zip file, this tutorial will let you download latest zip file

Redis-x64-3.2.100.zip. 2. Extract the zip file to prepared directory. enter image description here 3. Run redis-server.exe, you can either directly run redis-server.exe by clicking or run via command prompt. enter image description here 4. Run redis-cli.exe, after successfully running the redis-server. You can access it and test commands by running redis-cli.exe Te

enter image description here

PING command is used to test if a connection is still alive. enter image description here

You can now start using Redis , please refer for more commands in official documentations


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow