Skip to main content
The bunRedis adapter wraps Bun’s native Redis client for persistent caching. This is optimized for Bun runtime.
Bun Redis is part of Bun’s standard library. No additional dependencies required if using Bun.

Basic Usage

Redis Connection

Adapter Configuration

With Schema Serialization

Differences from ioredis

The bunRedis adapter uses Bun’s native Redis client which:
  • Faster: Native implementation in Bun
  • No dependencies: Built into Bun runtime
  • Same API: Drop-in replacement for ioredis adapter

Tiered Caching

Complete Example

Type Signature

SET Command Implementation

Bun’s Redis client uses send() for the SET command with TTL:
This is equivalent to:

Error Handling

Redis errors are converted to Effect failures:
Like the ioredis adapter, bunRedis uses Effect.orDie for Redis operations - errors will crash the fiber unless explicitly caught.