Skip to Content
Zurück zu: Elasticsearch vs. OpenSearch: Which Search Engine Fits Your Project?
Databases & Search 6 min. read

Redis as More Than a Cache: Queues, Sessions, and Pub/Sub

Redis is often reduced to caching. Yet it offers powerful data structures for queues, sessions, rate limiting, and real-time messaging.

devRocks Engineering · 03. February 2026 · Aktualisiert: 31. March 2026
Redis Queues Caching Laravel
Redis as More Than a Cache: Queues, Sessions, and Pub/Sub

Redis: A Swiss Army Knife

Redis is an in-memory data store with sub-millisecond latency. But it is far more than a key-value cache, its built-in data structures make it a versatile tool.

Queues with Redis

Laravel Horizon uses Redis lists and sorted sets for job queues. The advantages over database queues:

  • Performance: Redis processes millions of jobs per second, no database locks, no polling.
  • Priorities: Multiple queues with configurable worker assignments.
  • Monitoring: Horizon dashboard with real-time insight into queue utilization and errors.

Sessions and Rate Limiting

  • Sessions: Redis sessions are faster than database sessions and survive deployments (unlike file sessions).
  • Rate Limiting: Redis INCR with TTL is the foundation for Laravel's rate limiter, atomic and fast.
  • Distributed Locks: Cache::lock() uses Redis for mutex operations across multiple servers.

Pub/Sub and Streams

  • Pub/Sub: Real-time messaging between services, ideal for Laravel Broadcasting with WebSockets.
  • Streams: Persistent message queues with consumer groups, similar to Kafka but easier to operate.

Our Recommendation

In every Laravel project, we deploy Redis, at minimum for cache and sessions, often also for queues and broadcasting. With Redis Sentinel or Cluster, high availability is not an issue either.

Questions About This Topic?

We are happy to advise you on the technologies and solutions described in this article.

Get in Touch

Seit über 25 Jahren realisieren wir Engineering-Projekte für Mittelstand und Enterprise.

Weitere Artikel aus „Databases & Search“

Frequently Asked Questions

Redis is commonly used in Laravel for job queues as it supports lists and sorted sets. This allows for high performance since numerous jobs can be processed without database locks. Additionally, priorities and configurable worker assignments can be easily set up.
Redis offers significantly faster processing of sessions compared to databases. It allows for persistent storage across deployments and can scale better under peak load. Furthermore, managing sessions in Redis is less prone to errors than file-based sessions.
Redis' INCR function combined with a time-to-live (TTL) is optimal for implementing rate limiting. This method is not only fast and atomic but also avoids the complexity that can arise with traditional database systems.
Redis' Pub/Sub system enables real-time communication between different services. This is especially useful for applications that utilize WebSockets, such as broadcasting in Laravel, and allows for easy and efficient message delivery.
Yes, Redis can be configured for high availability through the use of Redis Sentinel or clusters. This ensures that even in the event of failures of individual instances, data integrity and service accessibility are maintained.

Didn't find an answer?

Get in touch