How to use basic Redis commands?

Category: Ruby :: Published at: 30.01.2023

Redis is quite easy to use, it's just basic key->value database which can be used in many different cases.

Let's assume, we already have Redis server setup in our application, and only need to use it.

Three most basic things we can do with Redis is:

  • setting up a new key
redis = REDIS_URL)
redis.set("lock_car_object_#{}", 1)
  • getting the value from existing key
redis = REDIS_URL)
=> 1
  • removing an existing key
redis = REDIS_URL)

- Click if you liked this article

Views: 801