Offline and synchronization with Instant Developer Cloud

by Andrea Maioli on 07/26/2016

This week’s article will bring us to the end of the interactive tour that has been teaching us how to develop apps with Instant Developer Cloud. And like the best action films, the most thrilling part has been saved for last.

People who develop apps know that you can’t count on internet connections that are always efficient and reliable. So, managing the offline state – that is, using the app even without a connection – and synchronization of its data with the cloud when it returns, are delicate subjects that are often complicated to handle.

Like Instant Developer Foundation, the Cloud edition also has a framework for offline operation: the same codebase can work both online and offline in the device. In the cloud, data access relies on a Postgres database, but when offline it uses the SQLite database in the device, and all the queries are adapted automatically.

For synching data, we were able to use the push architecture based on node.js in order to offer you an even more complete experience. In fact,

  • The synchronization process is now transparent to the application: it works in the background and exchanges data with the server independently.
  • Automatic user interface update functions are available when the data is updated, either locally or in the cloud.
  • Through a publish-subscribe pattern based on topics (interest channels) it’s possible to implement dynamic data distribution strategies.
  • The channel can be configured so that the data is sent and received in real-time, so that whatsapp-style messaging applications can be implemented as well.

The final stop on our interactive tour illustrates the main steps for setting up synchronization and lets you see real-time update functions firsthand.

I’m always interested in your opinions on this. Once you’ve tried it, let me know what you think!

Leave a Comment

Previous post:

Next post: