Basic Usages

Redis is a in-memory key-value database. It provides a database which works like a cache. It helps to reduce the loading stress in production. Redis is very fast as the data stored in memory. It always works as a middleware (cache layer) between application and traditional database. Application can just access the cached data which loaded from database previously.

Since it is a cache, data expiration is necessary as memory storage is so expensive. Also, it can be the middleware between process to let them do the data exchange.

It supports following types:

  • hashmap

  • string

  • integer

  • float

  • list

  • set

Note! Json is not officially support, we have to use redis-rejson to support it.

Common Command

Set | Get

redis> SET mykey "Hello"
redis> GET mykey
"Hello"

INCR | DESC

HSET | HGET

SADD | SCARD

LPUSH | RPUSH | LSET | LRANGE

Reference

Last updated

Was this helpful?