Skip to content

Get started

Quickstart

Start the server and use familiar Redis commands to store application state, build a queue, and expire data.

  1. Run the server

    Run the published container image without building from source:

    terminal
    docker run -d --name klyro -p 7171:7171 -v klyro-data:/data \
      ghcr.io/hitesh-s0lanki/klyro:latest

    Prefer a local binary? cargo build --release then ./target/release/klyro. Both listen on port 7171 by default. See installation for every option.

  2. Check the connection

    Any Redis client works, including redis-cli. Klyro also accepts inline commands, so nc is enough for a quick check.

    redis-cli -p 7171
    PING
    +PONG
  3. Store application state

    Strings hold simple values and counters. Hashes keep related fields together under one key.

    redis-cli -p 7171
    SET app:status ready
    +OK
    
    INCR metrics:requests
    :1
    
    HSET user:42 name "Mira" plan "pro"
    :2
    
    HGETALL user:42
    1) "name"
    2) "Mira"
    3) "plan"
    4) "pro"
  4. Build a worker queue

    Lists preserve insertion order. Producers can push jobs while workers use a blocking pop to wait without polling.

    producer
    LPUSH jobs:email '{"to":"mira@example.com","template":"welcome"}'
    :1
    worker
    BRPOP jobs:email 30
    1) "jobs:email"
    2) "{"to":"mira@example.com","template":"welcome"}"
  5. Expire temporary data

    Give temporary state a time-to-live and Klyro removes the key after the configured number of seconds.

    redis-cli -p 7171
    SET session:abc active EX 3600
    +OK
    
    TTL session:abc
    :3600
  6. Use it from your language

    TypeScript, Python, and Go have typed Klyro clients. Existing RESP clients can use the same commands.

    from klyro_db import Klyro
    
    db = Klyro()
    db.set("session:42", "active", ex=900)
    db.hset("user:42", mapping={"name": "Ari", "plan": "pro"})
    db.lpush("jobs", "generate-report")
    
    status = db.get("session:42")
    profile = db.hgetall("user:42")
    job = db.brpop("jobs", timeout=5)

Where to go next

  • Data types — commands for strings, lists, hashes, sets, and sorted sets.
  • Persistence — automatic snapshots, manual saves, and restart behavior.
  • Client libraries — connect from Python, Node.js, Go, or the command line.