Skip to content

Redis: Key/Value Store+

Overview

  • An in-memory data store, meaning it keeps the primary dataset in RAM for extremely fast performance.
  • Most commonly used as a high-speed cache, database, and message broker.
  • It is a key-value store, but the values can be complex data structures like lists, sets, hashes, and streams, not just simple strings.
  • Supports data persistence by optionally saving the in-memory data to disk, allowing for recovery after a restart.
  • Common use cases include session management, real-time leaderboards, application caching, and message queues.
  • Its operations are atomic, ensuring that a command either completes fully or not at all.
  • It has a client-server architecture and can be scaled for high availability and performance using features like Replication and Clustering.
  • Supports Pub/Sub (Publish/Subscribe) messaging patterns.

Up and Running

podman run -d \
  --name redis \
  --network llm-stack \
  -v redis:/data \
  -p 127.0.0.1:6379:6379 \
  redis:8.0 --requirepass PUT_REDIS_PASSWORD_HERE

podman logs -f redis

Usage

podman exec -ti redis bash
  redis-cli
    AUTH PUT_REDIS_PASSWORD_HERE
    SET mycounter 1
    KEYS *
    INCR mycounter
    GET mycounter
    DEL mycounter
    EXIT
  exit