Changelog

Redis

You can now add Redis to a stack. Alien creates a Redis-compatible server on a private network in your customer's cloud, and your code connects with the client it already uses: ioredis, node-redis, redis-py, or BullMQ.

alien.ts
const cache = new alien.Redis("cache")
  .memory("4Gi")
  .evictionPolicy("allkeys-lru")
  .build()

const api = new alien.Container("api")
  .code({ type: "image", image: "ghcr.io/acme/api:1.4.0" })
  .link(cache)
  .permissions("execution")
  .build()

export default new alien.Stack("acme")
  .add(cache, "frozen")
  .add(api, "live")
  .permissions({ profiles: { execution: { cache: ["redis/data-access"] } } })
  .build()
src/cache.ts
import { redis } from "@alienplatform/sdk"
import { Redis } from "ioredis"

const conn = await redis("cache").connection()
const client = new Redis({
  host: conn.host,
  port: conn.port,
  username: conn.username,
  password: conn.password,
  tls: conn.tls || undefined,
})

The server has no public endpoint, and TLS and a password are always on. connection() reads the password with the workload's own identity, so it never sits in an environment variable.

PlatformServer
AWSElastiCache for Valkey
Google CloudMemorystore for Valkey, through Private Service Connect
AzureAzure Managed Redis, through a private endpoint
Kubernetes, MachinesA server the customer provides, through an external binding
alien devValkey in Docker
  • Options: memory, eviction policy, persistence, a replica in another zone with automatic failover, and a customer-managed encryption key
  • One endpoint: Lua scripts, MULTI/EXEC, streams, pub/sub, and blocking commands work as on a plain Redis server
  • Python and Rust: the same connection(), and in Python redis.Redis(**conn.redis_kwargs())

Read the docs →