Basics of Redis


Redis is:

  • NoSQL
  • KeyValue
  • In memory
  • Data Structure Server
    • binary safe strings
    • lists, sets, sorted sets, hashes
    • bitmaps, hyperloglogs
  • Open source

Redis is:

  • Fast
  • Low CPU Requirement
  • Scalable

Redis can be used as:

  • Cache
  • Analytics
  • Leaderboard
  • Queues
  • Cookie storage
  • Expiring data
  • Messaging
  • High I/O workloads
  • API throttlings

How to persist your data

  • Snapshot
  • AOF: Append Only File


  • Redis has both data store and job queue built in
  • Redis is a data structure server so is has flexibe data structures
  • Redis is fast


  • Redis used a lot of RAM
  • Redis can be be queued by value


  • SQL
  • NoSQL
  • Flat file
  • Rabbit
  • ActiveMQ

How to Use it

Redis can be used as a handy data storage for data science projects. It can also be used as an API. Redis can be used on a medium data file. It can be used as a way to store medium size data file and also read out for analysis.



Invoke the command line


Useful commands

  • set: set test "just a test"
  • get: get test


redis on pypi

import redis

r \= redis.Redis(host\='localhost', port\=6379, db\=0)

print("setting keys")
r.set('test', 'just a test in python')

print('getting values')




The youtube channel Full Stack Book made a short video on how to integrate redis into FastAPI1.

Planted: by ;

wiki/computation/basics-of-redis Links to:

LM (2021). 'Basics of Redis', Datumorphism, 01 April. Available at: