Weave 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

ActiveRedis provides a simple, efficient, Eloquent-like active record API for interacting with Redis hashes in Laravel. Define models and create, update, delete, expire, and query records, with support for casts, events, timestamps, chunking, and searching.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on the Redis storage layer. The package replaces a hand-rolled "Redis hash + model" abstraction (key naming, UUID generation, TTL handling, casting, lifecycle events) with a maintained MIT library. Engineering effort saved is roughly the cost of writing and testing a small internal package — a few days to a sprint — for a pattern most Laravel teams re-implement badly.
  • Feature scoping for ephemeral, high-write data. The strongest fit is data that is naturally short-lived and volume-heavy: visit/event logs, request telemetry, OTP or reset tokens, rate-limit counters, feature-flag overrides, and lightweight job/state records. setExpiry() / getExpiry() make retention policy a first-class model concern instead of a cron job, which directly supports data-retention and privacy decisions.
  • Roadmap sequencing without infrastructure commitment. Because it rides on Redis you likely already run, a PM can greenlight a pilot without a new database, migration, or DBA review. This is a cheap way to validate an "event/ephemeral store" bet before committing to a managed store or a proper time-series solution.
  • Onboarding and consistency. An Eloquent-shaped API (create, find, query, chunk, each, events, observers, casts) means the existing team's mental model carries over. This lowers the bus factor versus a bespoke Redis helper only one engineer understands.
  • Operational hygiene. The README's recommendation to use a dedicated Redis connection/database for models is a decision point in itself — it lets you argue for keyspace isolation up front rather than after the cache, queue, and sessions collide with your model keys.
  • Schema and data-contract decisions. The searchable attribute list is effectively immutable once records exist. That forces an explicit, documented decision about what you will query on — useful discipline, but it must be treated as a schema sign-off, not a code detail.

When to Consider This Package

Adopt when most of these hold:

  • Stack is Laravel ≥ 9, PHP ≥ 8.1, Redis ≥ 3.0, and Redis is already operated (backups, monitoring, failover understood).
  • The domain object is a flat hash: identifiers plus a modest set of scalar/enum attributes. No joins, no relations, no aggregations.
  • Data is ephemeral or append-mostly, and TTL-based expiry is part of the design rather than an afterthought.
  • The keyspace per model stays in a regime where full SCAN iteration is acceptable (thousands, not tens of millions, of keys) or queries are overwhelmingly find()-by-key with only occasional iteration.
  • You know your searchable attributes before launch and can commit to them.
  • You can wrap the model in a thin internal repository/adapter so the library is swappable.

Look elsewhere when:

  • You need relational integrity, secondary indexes, sorting, range queries, joins, or aggregation. SCAN-with-pattern plus an immutable searchable field is not a query engine; reach for a relational DB, Redis Search/RediSearch, or a purpose-built store.
  • Keyspace will be large or unbounded. SCAN cost grows with the number of keys and Redis makes no count guarantees, so bulk operations become a latency and capacity risk.
  • You need multi-key atomicity or transactions across models — this is not modeled.
  • The work is core, revenue-critical, or long-lived. Adoption risk is real: 73 stars, 0 dependents, and a single-maintainer org. That is a small community and a genuine bus-factor concern for a dependency you can't easily replace.
  • The team lacks Redis operational experience; a package with an Eloquent-like surface encourages people to treat Redis like Postgres, which is the main failure mode here.

Net: viable for a bounded, non-critical feature; not a platform bet. Budget a short technical spike to confirm scan behavior and connection isolation before committing.

How to Pitch It (Stakeholders)

For executives / steering: This is a small, MIT-licensed Laravel package that gives our Redis hashes an Eloquent-style interface. It removes boilerplate for a pattern we'd otherwise write ourselves, adds built-in per-record expiry for retention control, and requires no new infrastructure. Cost to trial is a composer install, one connection config entry, and a handful of model classes. The trade-off is immaturity — tiny adoption, single maintainer — so we should not make it a strategic dependency. Recommendation: pilot it behind a thin internal interface on one ephemeral, non-critical feature, timeboxed, with an explicit exit path.

For engineering: You get models, UUID-or-custom keys, timestamps, casts and enums, lifecycle events and observers, TTL expiry, chunking, and a find/query API over Redis hashes. Two things to design around from day one: (1) queries use SCAN with a MATCH pattern, so bulk iteration is O(keyspace) — use find() where possible and keep per-model keyspaces small; (2) searchable attributes are effectively schema and must be frozen before production data exists. Also take the README's advice and give these models their own Redis connection/database so scans don't sweep cache, queue, and session keys. Wrap it in a repository so we can swap the backing store without touching call sites.

For the sponsor asking "what if it's abandoned": The package is thin and its surface is small; the escape hatches are (a) the internal adapter, and (b) the fact that the data lives in plain Redis hashes we can read directly with any client if we have to. That keeps the downside contained to migration effort, not data loss.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator