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

Key Value Storage Laravel Package

a4sex/key-value-storage

A simple key-value storage package for Laravel/PHP that lets you persist and retrieve arbitrary values through a clean, unified API. Useful for settings, caches, and lightweight configuration without the overhead of a full database model.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for a caching/persistence seam. This package is a thin implementation of the PSR-6 CacheItemPoolInterface / CacheItemInterface contract. The decision it actually informs is not "should we use this library" but "should we standardize on PSR-6 as our internal caching port." If the answer is yes, this package is one of many interchangeable adapters behind that port — meaningful for lock-in, less meaningful as a dependency.
  • Backend abstraction and swap readiness. Because the contract is an established PHP-FIG standard, any code written against it can move from in-memory to file to Redis to a database-backed implementation without touching feature code. That directly supports roadmap decisions like "ship the feature now on a simple store, migrate the backend after we see traffic."
  • Low-stakes use cases where this is sufficient. Feature flags, small config lookups, idempotency keys for webhook retries, rate-limit counters, short-lived job payloads, translation/dictionary lookups, and per-request memoization. These are places where a heavyweight cache stack is overkill and where a simple key-value contract is the right shape.
  • Deferring infrastructure investment. It supports the decision to not stand up Redis or a tagging-capable cache layer until a concrete requirement (cross-process sharing, eviction policy, tag invalidation) forces it. That is a real cost-avoidance and sequencing decision.
  • Vendor and framework decoupling. Choosing a PSR-backed store rather than a framework-coupled cache facade reduces the cost of a future framework upgrade or partial rewrite. Useful input when we are weighing how much Laravel-specific surface area to accept in shared libraries.
  • A diligence flag on the package itself, not the pattern. Zero stars, zero dependents, an unrated score, and a description that conflates "key-value storage" with PSR-6 caching pools (the simple key-value contract in PHP is PSR-16, not PSR-6). A PM should read that as: the architectural idea is sound and standard, the specific artifact is unvetted. That distinction is the decision.

When to Consider This Package

Consider it when all of the following hold:

  • You have already decided (or are deciding) to adopt PSR-6 as an internal interface, and you want a minimal, dependency-free implementation to prove the seam.
  • The data is ephemeral and reconstructible — losing it on restart is acceptable.
  • You need a single-process or low-concurrency store; you are not relying on atomic increment, distributed locks, or compare-and-swap semantics.
  • You are willing to read and own the source. At this adoption level the code is effectively a vendored snippet; budget for it as such.
  • You are wrapping it behind your own interface so the concrete package can be replaced without a refactor.

Look elsewhere when:

  • You need tag-based invalidation, hierarchical keys, or cache warming — that is Symfony Cache's territory, and the PSR-6 spec deliberately omits tags.
  • You need PSR-16 (Psr\SimpleCache\CacheInterface) semantics. If your requirement is genuinely "simple key-value storage," PSR-6 is the wrong contract — it forces getItem()/save() ceremony and item objects for what should be get()/set(). Do not let the package description drive the interface decision.
  • You need maintained dependencies. No stars, no dependents, and no visible release cadence is a supply-chain and bus-factor risk. If the code is mission-critical, fork it internally with attribution or reimplement it — the surface area is small enough that reimplementation is a realistic option.
  • You need operational guarantees: TTL enforcement you can trust, eviction behavior, persistence across deploys, memory bounds, or observability (hit/miss metrics). None of these are implied by a PSR-6 implementation.
  • You are on Laravel already. The framework ships a cache layer with a Redis/Memcached/database/file driver set, tag support, and Cache::remember ergonomics. Introducing a parallel, unmaintained abstraction to sit beside it adds a second caching idiom for the team to learn — usually a net negative. The exception is a shared library that must run outside Laravel.

How to Pitch It (Stakeholders)

To executives: This is a small decision, not a platform bet. The pattern — coding against a standard caching interface so the storage backend can be swapped later — is low-risk, widely used, and keeps us from hard-wiring ourselves to one vendor or framework. The package itself is an unproven open-source component with no visible user base, so we would not put it on a critical path. Recommended posture: adopt the interface, treat the implementation as disposable, and time-box any evaluation to a day or two.

To engineering: Treat this as a reference implementation of PSR-6, not a dependency you inherit. Read the source (it is small), confirm the semantics you actually need — TTL accuracy, key validation, concurrency behavior, serialization of non-scalar values — and put it behind our own port so swapping to Redis, Symfony Cache, or the framework's cache is a one-file change. Note the description says "key-value storage" but the contract is PSR-6 caching pools; if we want simple get/set, we should be talking about PSR-16. Flag any production use as requiring a fork-or-reimplement decision.

Bottom line for the roadmap: pursue the abstraction, not the package. Adopt PSR-6 (or PSR-16, if that is the real requirement) as an internal convention, ship the smallest backend that clears the current use case, and revisit when a concrete requirement — cross-process sharing, tag invalidation, or persistence — makes the choice non-optional.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource