Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Persistence Layer : MongoDB -> NeDB #7

Open
tdurand opened this issue Dec 16, 2020 · 7 comments
Open

Persistence Layer : MongoDB -> NeDB #7

tdurand opened this issue Dec 16, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@tdurand
Copy link
Member

tdurand commented Dec 16, 2020

No, we won't run MongoDB on android (for now ;-) )

https://github.com/louischatriot/nedb sounds perfect , we already used it for the twitter bot.. lightweight and it was working very well ( @b-g recommended this back in the days 🙌 )

TODO:

@b-g
Copy link
Member

b-g commented Dec 16, 2020

OK + great! :)

Just: Could we test whether a heavy recording eg. an entire days of 24h (which I guess will result in big files) will still work for all features? Happy to do the stress test with my phone once there is a alpha.

@tdurand
Copy link
Member Author

tdurand commented Dec 16, 2020

yep of course...

Also maybe I could properly evaluate what would be the cost of actually running mongodb on android, there is a SDK maybe it is not very hard.. : https://docs.mongodb.com/realm/android/install

@tdurand
Copy link
Member Author

tdurand commented Dec 16, 2020

PS: beta coming !! tomorrow or friday !

@tdurand
Copy link
Member Author

tdurand commented Dec 16, 2020

yep of course...

Also maybe I could properly evaluate what would be the cost of actually running mongodb on android, there is a SDK maybe it is not very hard.. : https://docs.mongodb.com/realm/android/install

Hum. this seems to be MongoDB Realm.. which is for now unclear to me what is it , is it free, is it the same API .. anyways.. for now I will just go to down the route to the fast and simple for the beta... and let's see if we need to move to more robustness later on

@b-g
Copy link
Member

b-g commented Dec 16, 2020

👍! Looking forward! :)

@tdurand
Copy link
Member Author

tdurand commented Dec 17, 2020

NB: first alpha ready: #3 (comment)

update on this.. turn out to be a little more complex than expected.. as always .. but working ! yeah

  • API isn't quite the same as MongoDB but it had all the features we needed .. so was able to make it work after trial an error, documented "diff" : opendatacam/opendatacam@development...evo-addnedbconnector , basically wrote a new DBManager with same API .. good thing is that is super trivial now to have an option in the config.json to choose between MongoDB or NeDB for persistence
  • every 5 min we run a compact database otherwise it grows really fast (200 MB for 10 mins).. but after compacting it takes only 50 kB from my test for each 5 min (it takes 100ms to compact ;-) ).. so for 24h I think it should take just a few MBs of space for a recording of this size.. but I need to benchmark better.. Also I think it might be the time to add an option to only persist counter data and not each frame of the tracker if we want.. most people don't care of the raw tracker data.

First impression is that it sounds good enough for the first android version.. but let's see after more tests

@tdurand tdurand added feature enhancement New feature or request and removed feature labels Dec 18, 2020
@b-g
Copy link
Member

b-g commented Dec 18, 2020

👍

Also I think it might be the time to add an option to only persist counter data and not each frame of the tracker if we want.. most people don't care of the raw tracker data.

Yes. We kind have for this also the swich off pathfinder setting ... but it would be a pitty to disable the pathfinder mode on default as maybe people won't notice them ... hence just a new switch "Record Raw Paths: y/n" (n = default)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants