ARK-Builders / arklib

Core of the programs in ARK family
MIT License
1 stars 10 forks source link

Persisted/Replicated index #15

Closed kirillt closed 1 year ago

kirillt commented 2 years ago

See https://github.com/ARK-Builders/ARK-Navigator/issues/142 for the context. TL;DR: At the moment, index is built for any "root" folder and stored in memory.

Would be cool to persist it, so we wouldn't recalculate resource ids on different devices. If we store the index into our .ark folder, then it cache gets synced to other devices (that's why replicated). Smart write to avoid conflicts is necessary, but would be too difficult for this moment, let's assume now that only 1 device writes index into some root at the same moment.

Let's fix .ark/index path for it.

kirillt commented 2 years ago

This is the only part of persisted/replicated storage (.ark subfolder of a root) which is not user-defined and allowed to be lost. The rest of the storage is unique user data, which must not be lost under any circumstances.

kirillt commented 2 years ago

Reminder: .ark folder is our "persisted and replicated storage" which gets synced to all other devices using Syncthing. Later, we might implement our own sync mechanism.