S
S
sugadu2016-10-10 20:31:27
JavaScript
sugadu, 2016-10-10 20:31:27

How to sync offline applications?

I am writing an offline application in Angular. You need to somehow organize the synchronization. And here are two questions:
1) In order for the application not to slow down, the user needs to work with data in RAM, but there is synchronization with localStorage.
2) It is necessary that when an Internet connection appears, data from localStorage is also written to the server.
Maybe someone has come across this. What is the best way to organize synchronization?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin   , 2016-10-20
@SynCap

A very good example is devdocs.io
+ Automatic synchronization
+ Storage - IndexedDB
+ full offline application stack with large data sets
+ damn, it's simple: 8 api calls to the browser!
By the way, people usually forget that both WebKit and Mozilla Local/Session Storage are organized on top of the built-in SQLite engine. This I mean that it is not kosher to store serious data in Storage when there is a powerful engine for storing data, not just Key-> ShortValue, but the Key-> Document engine (otherwise called NoSQL).
Let me explain the difference: in Local / Session Storage it is appropriate to store a small set of frequently used data with small specific values, to store documents - use the IndexedDB engine. It makes no sense to hide cookies in IDB - accessing Storage in this case is much faster, but pushing documents into Storage is already a complete perversion, in this case IDB will be hundreds of times faster.
In the aftermath: the once fashionable term NoSQL has essentially come down to Key->Document storage mechanisms, and modern document-oriented storages are now trying to adapt SQL to these engines.
Learn materiel, descendants!

A
Alexander Taratin, 2016-10-10
@Taraflex

The simplest way
https://pouchdb.com/
https://pouchdb.com/guides/replication.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question