Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
1 .Install
1 | $ wget http://download.redis.io/releases/redis-3.2.2.tar.gz |
The binaries that are now compiled are available in the src directory. Run Redis with:
1 | $ src/redis-server |
You can interact with Redis using the built-in client:
1 | $ src/redis-cli |
2. Super basic Commands(redis is case-insensitive):
add new key1
$ SET mykey "hello"
set expire time1
expire mykey 20
show all keys:1
$ key *
get key:1
$ get keyName
clean DB:1
$ flushdb
delete keys1
del key1 key2 key3
determine if key exist1
exists mykey
…………………………………………………………….