notes
notes copied to clipboard
Multiple-instance support: open multiple instance, one instance update can directly reflect on another instance
Currently, only single instance can be opened.
It would be nice to make notes
support multiple instance toward single database be opened simultaneously, because user may edit different pages within a single database.
And the content change in one instance can immediately take effect on another instance.
implementation
avoid data corruption:
- Use transaction feature of underlying database (SQLite).
- Use filelock (OS-level)
Aware the content update when other instance make change:
- save the last update timestamp in a file. If the time is newer than the in-memory record, synchronize the content.
- use file-watcher to keep track of file update.