LokiJS
maintenanceby Joe Minichino and contributors (techfort) · since 2014
In-memory JavaScript document store with indexes and pluggable persistence; no longer maintained.
maintenance. No release since 1.5.12 (April 2021) and no repository activity since 2023; effectively unmaintained.
Overview
LokiJS is a small in-memory document database for JavaScript that keeps collections in RAM, supports binary and unique indexes, dynamic views and simple MapReduce, and persists snapshots through adapters for IndexedDB, the file system or custom stores. It was popular in Cordova, Electron and Node apps that needed fast queries over a few thousand objects, and WatermelonDB still uses it as its web adapter. The project has had no release since 1.5.12 in 2021 and no commits since 2023, so treat it as legacy and prefer Dexie, RxDB or TinyBase for new work.
Strengths & trade-offs
Strengths
- +Very fast queries because everything is in memory
- +Tiny dependency with no native code
- +Dynamic views and binary indexes for quick filtered lists
Trade-offs
- −Unmaintained since 2021, with open bugs and no security fixes
- −Snapshot persistence can lose recent writes on crash
- −Whole dataset must fit in memory
Great for
- +Legacy apps that already depend on it
- +Small in-memory caches in Node or the browser
Think twice for
- −New projects
- −Durable storage of important data
- −Datasets larger than available memory
Capabilities
Native or official first-party support · 5 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- None
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded, In memory
- Query languages
- MongoDB-style query objects
Entire dataset lives in memory, so practical sizes are tens of MB.
Deployment
Ecosystem
Alternatives to LokiJS
The most popular IndexedDB wrapper, with live queries and an optional Dexie Cloud sync service.
lokijs vs dexie →Reactive local-first NoSQL database for JavaScript with pluggable storage and replication.
lokijs vs rxdb →Tiny reactive in-memory store for tables and values, with persisters and CRDT sync.
lokijs vs tinybase →Pure-JavaScript embedded datastore with a MongoDB-like API; the original is unmaintained.
lokijs vs nedb →JavaScript database for browsers and Node that speaks the CouchDB replication protocol.
lokijs vs pouchdb →Lazy-loading reactive database for React Native and React apps, built on SQLite.
lokijs vs watermelondb →LokiJS FAQ
What is LokiJS?
LokiJS is a document database by Joe Minichino and contributors (techfort), first released in 2014. LokiJS is a small in-memory document database for JavaScript that keeps collections in RAM, supports binary and unique indexes, dynamic views and simple MapReduce, and persists snapshots through adapters for IndexedDB, the file system or custom stores. It was popular in Cordova, Electron and Node apps that needed fast queries over a few thousand objects, and WatermelonDB still uses it as its web adapter. The project has had no release since 1.5.12 in 2021 and no commits since 2023, so treat it as legacy and prefer Dexie, RxDB or TinyBase for new work.
Is LokiJS open source?
Yes. LokiJS is open source. License: MIT License.
Does LokiJS support ACID transactions?
No. LokiJS does not provide ACID transactions; its consistency model is strong.
Does LokiJS scale horizontally?
LokiJS does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).
How can I run LokiJS?
You can self-host it and embed it in your application.
What is LokiJS best for?
LokiJS is a strong fit for legacy apps that already depend on it and small in-memory caches in Node or the browser. Think twice for new projects.
What are the best alternatives to LokiJS?
Common alternatives to LokiJS include Dexie.js, RxDB, TinyBase, NeDB and PouchDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
Is LokiJS still maintained?
LokiJS is in maintenance mode. No release since 1.5.12 (April 2021) and no repository activity since 2023; effectively unmaintained.
How popular is LokiJS?
LokiJS ranks #164 of 844 databases on the WhichDB Score (19.6/100), and #19 among document databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.


