Skip to main content

daravel_redis 1.14.0 copy "daravel_redis: ^1.14.0" to clipboard
daravel_redis: ^1.14.0 copied to clipboard

Redis and Valkey for Daravel across servers. Cache, locks, one-round-trip rate limits, queues without polling and broadcasting between servers.

Daravel

daravel_redis #

English · Bahasa Indonesia

Redis and Valkey for Daravel on several servers: a shared cache and locks, rate limits in one round trip, queues that start a job as soon as it is pushed, and broadcasting between servers. On one server Daravel needs none of it; its coordinator keeps that state in memory.

dartisan redis:install --docker   # or: dart pub add daravel_redis
// bootstrap/app.dart
import 'package:daravel_redis/daravel_redis.dart';

Application createApp() => Application.configure(basePath: '.')
    .withRedis()
    // ...
    .create();
REDIS_HOST=127.0.0.1       # or REDIS_URL=rediss://user:secret@host:6380/0
REDIS_PASSWORD=
CACHE_STORE=redis          # cache, locks, the JWT denylist
CACHE_LIMITER=redis        # rate limits
QUEUE_CONNECTION=redis     # jobs without polling (BLPOP)
REVERB_SCALING_ENABLED=true
REVERB_SCALING_DRIVER=redis
  • Speaks RESP itself, with pipelining on one connection per isolate, command timeouts, bounded in-flight commands and TLS. Tested on Redis 7 and Valkey 8.
  • One server, Sentinel (redis+sentinel://, found again after a failover) or Redis Cluster (redis+cluster://, slots, MOVED and ASK).
  • CACHE_STORE=tiered: each isolate's memory in front of Redis, kept exact by CLIENT TRACKING.
  • Queues on lists or on a stream with a consumer group (QUEUE_REDIS_ENGINE=stream); sliding-window and GCRA rate limits (Limit.perMinute(60).gcra()).
  • Locks are Laravel's RedisLock (keys, connection, release script), so Laravel and Daravel share them with the same CACHE_PREFIX; with REDIS_SERIALIZER=php they share cached values too. Queues stay apart from Laravel's (daravel: keys).
  • Cache tags, Redis.throttle and Redis.funnel in Laravel's keys, so both frameworks share them; sharded Pub/Sub; server-sent events that resume from Last-Event-ID (Redis.events('orders')).
  • cache:clear deletes the cache's own keys, never the whole database; redis:ping, redis:stats, redis:keys-audit, redis:inspect (also an MCP tool for AI agents), cache:prune-stale-tags and a read-only redis:cli (package:daravel_redis/commands.dart).

Documentation: https://github.com/daravel-dev/daravel/blob/main/docs/guide/redis.md.

License and trademarks #

MIT. "Laravel" is a trademark of Laravel Holdings Inc.; "Dart" is a trademark of Google LLC; Redis is a trademark of Redis Ltd.; Valkey is a project of the Linux Foundation. Daravel is an independent project, not affiliated with or endorsed by any of them.

0
likes
160
points
0
downloads

Documentation

Documentation
API reference

Publisher

verified publisherframework.daravel.dev

Weekly Downloads

Redis and Valkey for Daravel across servers. Cache, locks, one-round-trip rate limits, queues without polling and broadcasting between servers.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#redis #valkey #cache #queue #server

License

MIT (license)

Dependencies

crypto, daravel, dartisan_cli

More

Packages that depend on daravel_redis