Skip to content

Redis

Redis is a high-performance in-memory key-value store commonly used for caching, session management, message queues, and more. Piora lets you quickly deploy Redis instances and integrate them with your applications.

  1. Navigate to the “Databases” page in the dashboard
  2. Select “Redis”
  3. Choose a version (Redis 7 recommended)
  4. Configure parameters:
ParameterDescriptionExample
Service nameContainer identifiermy-redis
PasswordAccess password (optional)(auto-generated)
Max memoryMemory limit256mb
Terminal window
# Connection string with password
redis://:password@redis-container:6379
# Connection string without password
redis://redis-container:6379
# Specify database number (default is 0)
redis://:password@redis-container:6379/0
// Node.js (ioredis)
const Redis = require('ioredis');
const redis = new Redis(process.env.REDIS_URL);
// Basic operations
await redis.set('key', 'value');
const value = await redis.get('key');
# Python (redis-py)
import redis
r = redis.from_url(os.environ['REDIS_URL'])
r.set('key', 'value')
value = r.get('key')
// Express.js + connect-redis
const session = require('express-session');
const RedisStore = require('connect-redis').default;
app.use(session({
store: new RedisStore({ client: redisClient }),
secret: 'your-secret',
resave: false,
saveUninitialized: false,
}));
// Cache API responses
async function getCachedData(key, fetchFn, ttl = 300) {
const cached = await redis.get(key);
if (cached) return JSON.parse(cached);
const data = await fetchFn();
await redis.setex(key, ttl, JSON.stringify(data));
return data;
}
// Simple rate limiter
async function rateLimit(ip, limit = 100, window = 60) {
const key = `rate:${ip}`;
const count = await redis.incr(key);
if (count === 1) await redis.expire(key, window);
return count <= limit;
}

When Redis reaches its memory limit, an eviction policy determines what happens:

PolicyDescription
noevictionDon’t evict, reject writes when memory is full
allkeys-lruEvict least recently used keys (recommended)
volatile-lruOnly evict keys with an expiration set
allkeys-randomEvict random keys

Redis supports two persistence mechanisms:

  • RDB — Periodic snapshots, suitable for backups
  • AOF — Logs every write operation, higher data safety

In Piora, Redis has RDB persistence enabled by default, with data stored in Docker volumes.

The dashboard shows:

  • Memory usage and limits
  • Connection count
  • Operations per second (QPS)
  • Key count statistics