TaffyDB
maintenanceby Ian Smith (typicaljoe) · since 2009
Tiny in-memory JavaScript collection library with SQL-like filtering for the browser and Node.js.
maintenance. Last npm release 2.7.3 (2016) and last commit 2023; an unfixed advisory (CVE-2019-10790) applies. LokiJS, Dexie or RxDB are maintained options.
Overview
TaffyDB wraps an array of JavaScript objects in a queryable collection: you filter with object-based conditions (equality, comparisons, regex, has/like), sort, join two collections, update or remove matching records, and fire events, all in memory with no dependencies. It was a popular way to add database-style queries to browser apps around 2010-2015 and is still pulled in by older tooling. The last npm release, 2.7.3, is from 2016, the repository saw its last commit in 2023, and GitHub carries an unfixed high-severity advisory (CVE-2019-10790) about its internal ID index allowing access to arbitrary records. Prefer a maintained library for new code.
Strengths & trade-offs
Strengths
- +Zero-dependency, drop-in querying over plain JavaScript objects
- +Expressive filter syntax with sorting, joins and bulk updates
- +Works in the browser and in Node.js
Trade-offs
- −No releases since 2016 and an unfixed high-severity advisory
- −In-memory only; persistence is up to the application
- −Linear scans without real indexes on larger collections
Great for
- +Maintaining older front-end code that depends on it
- +Quick in-memory querying in small scripts
Think twice for
- −New projects
- −Untrusted input or security-sensitive data
- −Large datasets
Capabilities
Native or official first-party support · 3 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
- JavaScript filter objects
Everything lives in the JavaScript heap of one page or process.
Deployment
Ecosystem
Alternatives to TaffyDB
In-memory JavaScript document store with indexes and pluggable persistence; no longer maintained.
taffydb vs lokijs →The most popular IndexedDB wrapper, with live queries and an optional Dexie Cloud sync service.
taffydb vs dexie →Reactive local-first NoSQL database for JavaScript with pluggable storage and replication.
taffydb vs rxdb →Pure-JavaScript embedded datastore with a MongoDB-like API; the original is unmaintained.
taffydb vs nedb →JavaScript database for browsers and Node that speaks the CouchDB replication protocol.
taffydb vs pouchdb →The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering.
taffydb vs ehcache →TaffyDB FAQ
What is TaffyDB?
TaffyDB is a document database by Ian Smith (typicaljoe), first released in 2009. TaffyDB wraps an array of JavaScript objects in a queryable collection: you filter with object-based conditions (equality, comparisons, regex, has/like), sort, join two collections, update or remove matching records, and fire events, all in memory with no dependencies. It was a popular way to add database-style queries to browser apps around 2010-2015 and is still pulled in by older tooling. The last npm release, 2.7.3, is from 2016, the repository saw its last commit in 2023, and GitHub carries an unfixed high-severity advisory (CVE-2019-10790) about its internal ID index allowing access to arbitrary records. Prefer a maintained library for new code.
Is TaffyDB open source?
Yes. TaffyDB is open source. License: MIT License.
Does TaffyDB support ACID transactions?
No. TaffyDB does not provide ACID transactions; its consistency model is strong.
Does TaffyDB scale horizontally?
TaffyDB 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 TaffyDB?
You can self-host it and embed it in your application.
What is TaffyDB best for?
TaffyDB is a strong fit for maintaining older front-end code that depends on it and quick in-memory querying in small scripts. Think twice for new projects.
What are the best alternatives to TaffyDB?
Common alternatives to TaffyDB include LokiJS, Dexie.js, RxDB, NeDB and PouchDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
Is TaffyDB still maintained?
TaffyDB is in maintenance mode. Last npm release 2.7.3 (2016) and last commit 2023; an unfixed advisory (CVE-2019-10790) applies. LokiJS, Dexie or RxDB are maintained options.
How popular is TaffyDB?
TaffyDB ranks #236 of 844 databases on the WhichDB Score (14.3/100), and #24 among document databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.
