I saw another thread from last year that somewhat addressed the issue of syncing an offline app with an Elixir API but it didn’t seem to get much love. I’d like to discuss it again to see if there are new options for solving this problem in 2017.
I’m looking at creating a desktop version of my web app and syncing it with my elixir backend after it has gone offline and reconnects. My desktop app will be written in Electron and will basically be a modified version of the static React frontend. I’m going to need some type of local store for the Electron app that will sync with the Elixir backend. I’ve looked at PouchDB and CouchDB as a possible solution. If anyone here has gone that route I’d appreciate any advice/recommendations you have to offer. I’d have to move my current DB to Couch which would be a bit of a PITA but doable.
Has anyone accomplished offline sync with Postgres? I’m not aware of any projects that would make this easy to do. I also have part of my data in Mongo so if you’ve done offline with Mongo I’d appreciate any suggestions.
The offline version of this app isn’t super high priority but would be a nice to have. As a result, I can’t spend a ton of time learning the ins and outs of something like CRDT’s to implement a custom syncing solution. I’m looking for something a little more off the shelf if possible. Curious to hear what others experiences have been like.
What do the Electron folk normally suggest?
I think @kofno has worked with an Electron so maybe he has some ideas…
I guess depending on how much and what type of data you want to sync, maybe using PouchDB to sync with PouchDB Server with a Postgres backend would work?
PouchDB can be used offline. If you want to take advantage of it’s syncing mechanism, then it would need to talk to a back end that implements the couchdb syncing protocol. It generally works pretty well in that scenario.
There are “Backend as a Service” offerings that offer offline/disconnected modes. Firebase looks like it has “disconnected” support, though I haven’t gotten to try it yet.
As far as an Electron or Elixir specific, drop in offline support… I can’t think of anything like that off the top of my head.
@benperiton @kofno Thanks for the suggestions! I looked into Firebase last week and the JS SDK doesn’t have offline support (I think it’s only for Android right now? Maybe iOS too). Pouch/Couch does seem like the most promising option at the moment. Do either of you have experience with Couch? I guess the only thing to do now is build a little toy app to see how it works. After that, if all goes well, I can try migrating my mongo database to couch and then get pouch working on the frontend. I’ll give it a try!
I’ve done a little couch. I like it. I suspect your mongo data will
transfer pretty easily. Pouchdb is pretty slick, too. You should enjoy
playing w/ that tech, I would think