Hacker News new | ask | show | jobs
by m_mueller 2929 days ago
What I’d do is running a full blown database application on the device. Couchbase Lite can do that as an example - replicate to a Couchbase server and allow offline access to data and indices. If your server part is Node.js based you should be able to have the whole thing running offline on devices.

Why? I’m Swiss. We drive a lot of trains and they enter a lot of tunnels. Or on the plane. Or on a mountain. Imagine you can just keep on editing all your business data and sync the delta once you get a connection.

3 comments

In the past I've used PouchDB inside a webview for this use-case.
This is pretty much what Firebase is. https://firebase.google.com/docs/database/
You may be interested in a new way to develop web applications that I have been developing. An entire site is represented in JSON, and pages are built by Javascript in the browser. This greatly reduces server calls, making it much faster as well as largely working offline.

The site is in late alpha: https://www.sparational.com/

(If you goto the Login screen and enter an unused username and password, it will create an account for you.)

What makes this a better approach than having something like React run in a ServiceWorker?

www.sparational.com seems to have gone down since I started writing this comment, but when I clicked on the link, it seemed to have quite a considerable wait until anything appeared on the screen.

On my phone, it just says application error
Which browser? I've tested on desktop Chrome, mobile Chrome, and mobile Firefox.

IE and Edge aren't currently supported, and might never be.

I tried Firefox Focus, Firefox Mobile, and Chrome. Just tested again and it's working now though. Looks interesting!