NeDB is a lightweight embedded document DBMS written in JavaScript. It supports Node.js, nw.js, Electron, and web browser environments. It is designed to be partially compatible with MongoDB's JSON-based query API. NeDB is useful for storing small amounts of data in memory. When the amount of data exceeds the bounds of what NeDB can hold effectively, switching to MongoDB is intended to be straightforward because it uses the same API.[03][04][01]
- Source Code
- https://github.com/louischatriot/nedb[01]
- Developer
- Country of Origin
- FR
- Start Year
- 2013 [10]
- End Year
- 2017 [11]
- Project Type
- Open Source
- Written in
- JavaScript
- Supported Languages
- JavaScript
- Inspired By
- Redis
- Compatible With
- MongoDB
- License
- MIT License
NeDB is a lightweight embedded document DBMS written in JavaScript. It supports Node.js, nw.js, Electron, and web browser environments. It is designed to be partially compatible with MongoDB's JSON-based query API. NeDB is useful for storing small amounts of data in memory. When the amount of data exceeds the bounds of what NeDB can hold effectively, switching to MongoDB is intended to be straightforward because it uses the same API.[03][04][01]
History
In May 2013, Louis Chatriot began developing a lightweight embeddable and in memory database system that used a subset of the MongoDB API. It was completed in 2017 and now is on GitHub where individuals can contribute to the project by fixing several bugs but no additional features are being implemented.
Concurrency Control[05]
NeDB does not support currency because each process receives it's own copy of the database and there is no way to sync the views that two separate processes have of the database. Additionally, Javascript is inherently single-threaded resulting in no concurrency.
Indexes[06][07][08]
NeDB supports indexing and helps provide a sufficient speed boost. It allows for indexing of any field, including those in nested documents. An index can be created at any point, even after data has been inserted, although it is most efficient if done when the application is started because the index is created synchronously. The time to create an index is quite fast so it doesn't impact startup time too much, for example it takes 35ms for a database containing 10,000 documents. Additionally, indexes allow for the database to perform fast reads and writes. The amount is approximately 5,000 writes and 25,000 reads per second.
Joins[09]
NeDB does not support joins because it is not a relational database but rather a document store database.
Logging[03]
NeDB does not support logging because all data is stored in memory. However, a NeDB logger has been created that can be used to insert documents into a NeDB-readable database.
Storage Architecture
The DBMS reads the entire database into memory. It can then flush out all changes on shutdown.
Citations
11 sources- GitHub - louischatriot/nedb: The JavaScript Database, for Node.js, nw.js, electron and the browser · GitHub github.com
- Home · louischatriot/nedb Wiki · GitHub github.com
- https://www.npmjs.com/package/nedb npmjs.com
- NeDB: A Lightweight JavaScript Database stackabuse.com
- Multiple node processes support with a single datastore file · Issue #105 · louischatriot/nedb github.com
- Indexing · louischatriot/nedb Wiki · GitHub github.com
- Server-side JavaScript - Database Manual - MongoDB Docs mongodb.com
- nedb/lib/indexes.js at master · louischatriot/nedb · GitHub github.com
- Documentation: Join/Merge · Issue #541 · louischatriot/nedb github.com
- Initial commit github.com
- Is this still maintained? · Issue #492 · louischatriot/nedb github.com