-
Notifications
You must be signed in to change notification settings - Fork 26
Offline Support
Web apps typically use a request/response model which assumes that you're always online and then they try to patch things up when you aren't.
FOAM, on the other hand, uses a much simpler database model (ie. DAO's), which assumes that you're offline and just writes updates and performs queries to an offline database. Then, when you're actually online, it simply syncs your database with the server and merges server and local query results.
The request+response model has proven to be extremely difficult and time consuming to make robust and reliable, whereas the DAO model is inherently reliable because storing to stable storage is always the first operation.
FOAM's SyncManager is used to sync between local DAO's (IndexedDB, local-storage, Chrome-storage, file DAO's) and remote network DAO's (RESTDAO). FOAM's SplitDAO is used to merge query results from local and remote storage.