Note that there are some explanatory texts on larger screens.

plurals
  1. POArchitecture for data layer that uses both localStorage and a REST remote server
    primarykey
    data
    text
    <p>Anybody has any ideas or references on how to implement a data persistence layer that uses both a localStorage and a REST remote storage:</p> <p>The data of a certain client is stored with localStorage (using an ember-data indexedDB adapter). The locally stored data is synced with the remote server (using ember-data RESTadapter). </p> <p>The server gathers all data from clients. Using <a href="http://en.wikipedia.org/wiki/Set_theory" rel="nofollow noreferrer">mathematical sets</a> notation:</p> <pre><code>Server = Client1 ∪ Client2 ∪ ... ∪ ClientN </code></pre> <p>where, in general, any record may not be unique to a certain client:</p> <pre><code>ClientX ∩ ClientY ≠ 0, ∀ X,Y ∈ [1,N] </code></pre> <p>Here are some scenarios:</p> <ul> <li><p>A client creates a record. The id of the record can't be set on the client, since it may conflict with a record stored on the server. Therefore a newly created record needs to be committed to the server -> receive the id -> create the record in localStorage.</p></li> <li><p>A record is updated on the server, and as a consequence the data in localStorage and in the server go out of sync. Only the server knows that, so the architecture needs to implement a push architecture (?)</p></li> </ul> <p>Would you use 2 stores (one for localStorage, one for REST) and sync between them, or use a hybrid indexedDB/REST adapter and write the sync code within the adapter? </p> <p>Can you see any way to avoid implementing push (Web Sockets, ...)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload