A simple key-value storage interface with support for multiple backends, TTL expiry, and serialization.
Keyv is a simple key-value storage library that provides a unified interface for interacting with multiple storage backends, such as Redis, PostgreSQL, SQLite, and in-memory stores. It solves the problem of inconsistent APIs across different storage solutions by offering a single, consistent interface with built-in TTL support for caching and data expiry.
Developers building Node.js applications that require flexible caching, persistent key-value storage, or a consistent storage layer across multiple environments (e.g., switching between local development and production databases).
Developers choose Keyv for its simplicity, extensibility, and backend-agnostic design, allowing them to easily swap storage solutions without changing application code, while benefiting from features like TTL and optional compression.
Simple key-value storage with support for multiple backends
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a consistent API across in-memory, Redis, PostgreSQL, and other backends, allowing easy swaps without code changes, as highlighted in the unified storage interface feature.
Built-in time-to-live support automates data expiry, making it ideal for caching scenarios, with TTL mentioned as a core feature for persistent storage.
Supports numerous storage adapters like DynamoDB and MongoDB, with community-driven third-party options, enabling flexibility across diverse environments.
Includes JSON, SuperJSON for complex types like Date and Map, and MessagePack for performance, providing multiple serialization choices as separate packages.
Adapters for Brotli, Gzip, and LZ4 reduce storage footprint, beneficial for large datasets, with compression support detailed in the README.
The uniform API layer can introduce performance penalties compared to directly using native database clients, as it adds an extra step for operations.
Managing multiple adapter packages and their configurations in the monorepo structure adds initial setup burden, especially when integrating various backends.
As a strict key-value store, it lacks support for advanced queries, indexing, or transactions, restricting use to simple get/set operations.
The ongoing v6 development with major changes like improved TypeScript support indicates potential breaking updates, requiring migration efforts from v5.