louischatriot / nedb

The JavaScript Database, for Node.js, nw.js, electron and the browser
MIT License
13.51k stars 1.03k forks source link

How to combine and query two databases with same type #602

Open VigneshVaidyanathan opened 5 years ago

VigneshVaidyanathan commented 5 years ago

Hello guys, I am new to Ne Db and I am trying to create an Electron app. The db that I am using is currently storing 500kb of data for one day of work. So considering the fact that the user will be using this daily, the size of the db grows considerably in a weeks time, which would make the operations slower.

I don't need to access the week-old or month old data on a day to day basis ie frequency of querying that is less. So I was thinking to split out the week's data into a separate database so only current week's data is present in the active database (much like a log file).

Now when I want to query data from all databases, the only option I got is to query each database and hold the data in memory, merge with the remaining database records and perform the final query. This could significantly increase the memory used since the data is kept at the memory.

Let me know if there is a better way to handle this :D

briggsywxf commented 5 years ago

This is not an issue with NEDB itself. It states clearly on the front page of the repository that only bug reports and feature requests belong in "issues". I suggest you ask on StackOverflow instead.