4 ms·
For the last 6-8 months I've been working on a hybrid electron + web app that uses files on local disk for storage. I have a Datastore implementation that uses
by burtonator 7y ago
For the last 6-8 months I've been working on a hybrid electron + web app that uses files on local disk for storage.
I have a Datastore implementation that uses disk when locally and firebase when remote.
https://getpolarized.io/2019/03/22/portable-datastores-and-platform-independence.html https://getpolarized.io/2019/03/22/portable-datastores-and-p...
You can read about it there.
I thought it would be a great idea to use just simple flat files as you can commit them to git, diff them, and there's kind of already an API for working with them.
In retrospect I regret it and wish we had something more powerful.
First. It's twice as much code to maintain. Which introduces bugs.
Seconds if you're keeping your PDFs online vs on disk they're duplicated. It would be nice to build in a higher level abstraction that was both network AND disk aware and just pulled things down when you needed it.
Third, the annotations on your PDF aren't really indexable without a 3rd party system.
Getting the right balance of remote-first vs web-first is tough.
Now, after building a complex webapp with electron support I think it's better to go web-first and then try to use the browsers local caching to get offline-first support.