0

I am planning to create a web application using Node.js and Meteor Framework with mongoDB. This application will be critical for the business operation, so ideally it should be able to handle network failure.Is this possible? Or my only option here is to create a stand-alone application? The application will probably be run on either a PC or a tablet.

Are there any existing solution for this?

One Idea I have is, is it possible to have a local cache of the user's database on the machine. When the network is up, this cache might not be used but continually updated. But when the network failed, then the connection will be hand off to this database so operation can continue as usual. When the network is back up, this database will sync with the our server and back to normal mode.

In case of a PC, we might be able to run a local server manually to get the webpage backup. I couldn't think of a solution for the tablet though.

harinsa
  • 3,176
  • 5
  • 33
  • 53
  • 1
    A better solution would be to use offline storage, such as localstorage. When the application detects no connection, switch to the offline storage and synchronize when it comes back. – Ben Fortune Nov 05 '14 at 11:09
  • I am guessing that none of the information would be in any way sensitive and it would be fine for any of your users to see other users' data as well as any other piece of information stored in your app. If that's not so, you should look at the problem differently and seek ways to present a somewhat smooth experience to the user at those times they are offline. Or perhaps segment parts of your application that would be eligible/not for offline use. The proper tools for offline data storage than would be localstorage and wrappers to that. – Serkan Durusoy Nov 05 '14 at 11:35

2 Answers2

1

it sounds like you are looking for PouchDB. It works with CouchDB as a backend instead of Mongo, but I think these two are quite similar. PouchDB is a local Javascript based DB on the client device. It syncs with 'real' DB once client is online again.

I am not affiliated with them, and I use Mongo daily as well, never actually tried CouchDB before, but might be worth having a look.

  • That's what I am looking for, too bad Pouch doesn't work with Mongo. I have found a better solution though. It seems Meteor actually support this out of the box. – harinsa Nov 05 '14 at 12:29
1

Meteor actually support this out of the box. I guess I was searching with the wrong terms. Check out the link below for more information.

How can Meteor apps work offline?

Community
  • 1
  • 1
harinsa
  • 3,176
  • 5
  • 33
  • 53