jmcfarlane / notable

Notable - a simple note taking application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternate storage location

davmaz opened this issue · comments

Great application! But how can the notable storage be located on a Google Drive rather than .notable ?

The database (BoltDB) and full text index (Bleve) require filesystem access. Are you looking for a feature that would automatically backup these files to a cloud provider of some kind (S3, Google drive, Azure whatever, etc)?

I would like to have all of the storage for notable exist on a Google Drive. I made a directory (.notable) on my Google Drive, then I made a symbolic link to it from my home directory. However, when I change notable entries, it doesn't sync them properly (because it's a hidden file?).

I could make a hard link.

Hey Dave,

Notable persists data to a single directory. By default the storage looks like this:

$ tree ~/.notable
/home/jmcfarlane/.notable
├── notes.db
└── notes.db.idx
    ├── index_meta.json
    └── store

I happen to store the data on a different folder that automatically gets backed up. I don't include the index data because it's ephemeral (can be recreated at any time). Here's what I currently use:

$ tree ~/.notable
/home/jmcfarlane/.notable
├── notes.db -> /home/jmcfarlane/Sync/Notes/notes.db
└── notes.db.idx
    ├── index_meta.json
    └── store

A test setup can be observed by running the following commands:

$ mkdir /tmp/dave
$ notable -port 8081 -daemon=false -db=/tmp/dave/notes.db

Results in data like this:

$ tree /tmp/dave
/tmp/dave
├── notes.db
└── notes.db.idx
    ├── index_meta.json
    └── store

I don't happen to have any experience with mounting google drive, but what you described should work just fine (I've ran mine that way since the very beginning). For what it's worth I just pushed up 0.0.10 as a pre-release version. It includes a few fixes to the boot process, and might bubble up errors previously hidden.

https://github.com/jmcfarlane/notable/releases/tag/v0.0.10

That sounds about right. Notable supports backup/replication via simple file copy (say using awscli or whatever), but it is not a distributed datastore - meaning there (currently) cannot be multiple readers/writers.

It so happens I had a crazy idea that might just make this situation plausible. I'll see if I can code it up on a topic branch for testing :)

@davmaz if you wanna give this a test, an experimental release can be found here:

https://github.com/jmcfarlane/notable/releases/tag/v0.1.0

The raw steps would be to do:

  1. Run notable per usual on a machine that has some sort of file sharing enabled. Being sure to write the database to that shared location, via the -db option.
  2. Run notable with -db pointing to the same shared location on another computer, and also add the -secondary flag.

^ will setup a primary and secondary, where both are available for writes (and changes sync up <=4 seconds + the sync time of whatever service you're using. If you happen to give this a shot I'd low to know how it goes (and on which platform you try it :)

Closing as fixed.