# typicode/lowdb

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/typicode-lowdb).**

22,469 stars · 958 forks · JavaScript · mit

## Links

- GitHub: https://github.com/typicode/lowdb
- awesome-repositories: https://awesome-repositories.com/repository/typicode-lowdb.md

## Topics

`database` `electron` `embeddable` `embedded-database` `javascript` `json` `localstorage` `lodash` `nodejs` `storage`

## Description

Lowdb is a lightweight local data persistence library that manages application state as a JSON document. It functions as a database utility that stores information directly in local files or browser storage, removing the requirement for a dedicated database server or complex infrastructure. By treating stored data as standard objects and arrays, it provides a straightforward interface for managing application information.

The library distinguishes itself through a modular adapter-based architecture that decouples data manipulation from the underlying storage medium. This design allows for the implementation of custom storage backends, including support for data transformations like encryption or compression. It also maintains a complete copy of the database in volatile memory, which enables high-speed operations and facilitates the use of in-memory storage modes to accelerate automated test suites.

Beyond basic storage, the project supports data integrity through atomic write serialization, which ensures that the entire state is saved as a single operation to prevent corruption. It also provides mechanisms for schema validation, allowing developers to check database content against predefined structures to maintain consistent data formats. The library can be extended by integrating third-party utility libraries for complex queries or by linking database adapters to web servers to expose data through network endpoints.

## Tags

### Data & Databases

- [Flat-File Databases](https://awesome-repositories.com/f/data-databases/flat-file-databases.md) — Manages application state by persisting data directly to local JSON files.
- [JSON Document Stores](https://awesome-repositories.com/f/data-databases/json-document-stores.md) — Stores application state as a single JSON document in local files for persistent, document-oriented data management.
- [Local Persistence Layers](https://awesome-repositories.com/f/data-databases/local-persistence-layers.md) — Stores application state in local files or browser storage to maintain user information without a dedicated database server.
- [Local File Storage](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/file-based-storage/local-file-storage.md) — Persists application information directly onto local disk storage for simple and type-safe data management. ([source](https://github.com/typicode/lowdb#readme))
- [Data Storage Adapters](https://awesome-repositories.com/f/data-databases/data-storage-adapters.md) — Provides a modular adapter pattern to decouple data manipulation logic from various storage backends.
- [In-Memory Data Stores](https://awesome-repositories.com/f/data-databases/in-memory-data-stores.md) — Maintains a complete copy of the database in volatile memory for high-speed operations and accelerated testing.
- [Browser-Based Storage](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/client-side-persistence/browser-based-storage.md) — Maintains application state within browser storage to keep user information available across sessions. ([source](https://github.com/typicode/lowdb/blob/main/src/examples))
- [Atomic File Operations](https://awesome-repositories.com/f/data-databases/data-governance-modeling/data-management-governance/data-integrity-validation/data-integrity/atomic-file-operations.md) — Ensures data integrity by performing write operations as atomic transactions to prevent file corruption.
- [Atomic File Updates](https://awesome-repositories.com/f/data-databases/data-integration-synchronization/data-integrity-versioning/atomic-file-updates.md) — Protects data integrity by performing write operations as single atomic transactions. ([source](https://github.com/typicode/lowdb#readme))
- [Data Access Providers](https://awesome-repositories.com/f/data-databases/data-access-providers.md) — Offers a flexible interface that treats stored data as standard JavaScript objects and arrays for intuitive manipulation.
- [Storage Backend Adapters](https://awesome-repositories.com/f/data-databases/storage-backend-adapters.md) — Supports custom storage backends and data transformations like encryption or compression through modular interfaces. ([source](https://github.com/typicode/lowdb#readme))
- [Type-Safe Data Abstractions](https://awesome-repositories.com/f/data-databases/type-safe-data-abstractions.md) — Ensures consistent data formats by validating stored information against predefined schemas.

### Part of an Awesome List

- [Database Utilities](https://awesome-repositories.com/f/awesome-lists/data/database-utilities.md) — Small database powered by Lodash.
- [Databases](https://awesome-repositories.com/f/awesome-lists/data/databases.md) — Local JSON database for small projects.

### Software Engineering & Architecture

- [Data Schema Validation](https://awesome-repositories.com/f/software-engineering-architecture/data-schema-validation.md) — Validates database content against predefined structures to maintain consistent data formats during runtime. ([source](https://github.com/typicode/lowdb/blob/main/README.md))

### DevOps & Infrastructure

- [Custom Storage Adapters](https://awesome-repositories.com/f/devops-infrastructure/custom-storage-adapters.md) — Extends database functionality by implementing modular interfaces for custom storage backends.
