Node. js supports all kinds of databases no matter if it is a relational database or NoSQL database. However, NoSQL databases like MongoDb are the best fit with Node.
Node. js can be used in database applications. One of the most popular databases is MySQL.
Node. js allows you to run JavaScript on the server.
js receives a CPU bound task: Whenever a heavy request comes to the event loop, Node. js would set all the CPU available to process it first, and then answer other requests queued. That results in slow processing and overall delay in the event loop, which is why Node. js is not recommended for heavy computation.
I had the same requirements as you but couldn't find a suitable database. nStore was promising but the API was not nearly complete enough and not very coherent.
That's why I made NeDB, which a dependency-less embedded database for Node.js projects. You can use it with a simple require()
, it is persistent, and its API is the most commonly used subset of the very well-known MongoDB API.
https://github.com/louischatriot/nedb
Lokijs: A fast, in-memory document-oriented datastore for node.js, browser and cordova.
LokiJS to be the ideal solution:
https://github.com/techfort/LokiJS
NeDB seems to be what you are looking for. From the blurb:
Embedded persistent database for Node.js, written in Javascript, with no dependency (except npm modules of course). You can think of it as a SQLite for Node.js projects, which can be used with a simple require statement. The API is a subset of MongoDB's. You can use it as a persistent or an in-memory only datastore.
Take a look at http://www.tingodb.com. I believe it does what you looking for. Additionally it fully compatible with MongoDB API. This reduces implementation risks and gives you option to switch to heavy solution as your app grows.
https://github.com/sergeyksv/tingodb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With