Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Activeredis Laravel Package

directorytree/activeredis

Active Record-style Redis hash models for Laravel. Create, update, delete, expire, and query Redis-backed records with an Eloquent-like API, including model identifiers, timestamps, casts, events, connections, chunking, searching, and testing support.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Real-time data caching: Accelerate read-heavy applications (e.g., analytics dashboards, session tracking) by storing transient data in Redis with an Eloquent-like API.
  • Build vs. Buy: Avoid reinventing Redis integration wheels; leverage this package to reduce dev time for Redis-backed models (vs. raw Redis clients or custom implementations).
  • Use Cases:
    • Temporary data: User sessions, visit tracking, or ephemeral records (e.g., Visit models in the example).
    • High-throughput APIs: Cache API responses or rate-limiting data with TTL (expiry) support.
    • Event sourcing: Store immutable event snapshots in Redis for replayability.
    • Multi-tenant isolation: Dedicated Redis connections per tenant (via connection property) to avoid key collisions.
  • Roadmap Enablers:
    • Feature flags: Store feature flag configurations in Redis with TTL for A/B testing.
    • Searchability: Add full-text search (via searchable attributes) to Redis-backed models without a separate search engine.
    • Hybrid persistence: Combine Redis (for speed) with a relational DB (for durability) by syncing critical data.

When to Consider This Package

  • Adopt if:
    • Your app needs fast, temporary data storage (sub-second reads/writes) with automatic expiry.
    • You’re using Laravel and want an Eloquent-like API for Redis (reduces learning curve).
    • You need atomic operations (e.g., create with UUID generation, update with timestamps) without manual Redis scripting.
    • Your data fits in memory (Redis is not a replacement for persistent storage like PostgreSQL).
    • You require searchable attributes but don’t want to integrate Elasticsearch/Solr.
  • Look elsewhere if:
    • You need complex queries (joins, aggregations)—use PostgreSQL or a dedicated search engine.
    • Your data is persistent (use Eloquent or a traditional DB).
    • You need transactions across multiple Redis operations (this package uses single-key atomicity).
    • Your team lacks Redis expertise (misconfigured TTLs or key patterns can cause data loss).
    • You require high availability (Redis clustering setup is outside this package’s scope).

How to Pitch It (Stakeholders)

For Executives: "ActiveRedis lets us store high-velocity data (e.g., user visits, feature flags) in Redis with the simplicity of Laravel’s Eloquent. This reduces latency for read-heavy workloads by 10–100x vs. SQL, cuts dev time by reusing familiar ORM patterns, and enables automatic expiry for compliance (e.g., GDPR). For example, we could track real-time analytics without bloating our PostgreSQL database. The MIT license and active maintenance make it a low-risk choice."

For Engineering: *"This package gives us:

  1. Eloquent-like syntax for Redis (e.g., Visit::find($id), Visit::create([...]))—no raw Redis commands.
  2. Automatic UUIDs, timestamps, and TTLs—reduces boilerplate.
  3. Searchable attributes—query Redis hashes by field (e.g., Visit::where('ip', '192.168.1.1')) without a separate search layer.
  4. Isolated connections—dedicate a Redis DB to our models to avoid key collisions with queues/cache. Tradeoff: Limited to single-key operations; complex queries still need PostgreSQL. Ideal for transient, high-read data like sessions or event logs."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport