- Document Number:
20220239737
- Appl. No:
17/584742
- Application Filed:
January 26, 2022
- Abstract:
A system to synchronize application data bidirectionally between N clients and one server, by: (a) pushing mutations made in the client to the server, wherein each mutation is comprised of a mutation name identifying the type of mutation, and arguments provided by the application modifying the behavior of the mutation, and the pusher also pushes a client ID and mutation ID for each mutation to the server; (b) pulling server differentials to the client; (c) storing key/value pairs in a versioned cache, wherein the keys are text strings and the values are data provided by an application in the client; and (d) resolving conflicts between the client and the server with a rebaser that: forks the cache to create a synch branch when the client receives the latest server differential, applies the latest received server differential to the synch branch, applies only those mutations to the synch branch that have not already been acknowledged by the server, and then makes the synch branch the main branch of the cache.
- Assignees:
ROCICORP, LLC (Kailua, HI, US)
- Claim:
1. A system to synchronize application data bidirectionally between N clients and one server, comprising: (a) providing a computer system comprising N clients and a server; (b) for each of the N clients, providing: (i) a pusher that pushes mutations made in the client to the server, wherein each mutation is comprised of a mutation name identifying the type of mutation, and arguments provided by the application modifying the behavior of the mutation, and the pusher also pushes a client ID and mutation ID for each mutation to the server; (ii) a puller that pulls server differentials to the client; (iii) a versioned cache that: stores key/value pairs, wherein the keys are text strings and the values are data provided by an application in the client, is versioned to store historical versions of the key/value pairs, and is forkable to store parallel historical versions of the key/value pairs; and (iv) a rebaser that resolves conflicts between the client and the server by: forking the cache to create a synch branch when the client receives the latest server differential, applying the latest received server differential to the synch branch, applying only those mutations to the synch branch that have not already been acknowledged by the server, and then making the synch branch the main branch of the cache.
- Claim:
2. The system of claim 1, further comprising: (c) a system for iteratively generating the server differentials by comparing snapshots of the server at consecutive periods of time.
- Claim:
3. The system of claim 1, wherein the server is one of a web service, a data layer, a single physical server or a plurality of separate physical machines operating together as one logical server.
- Claim:
4. The system of claim 1, wherein the system for iteratively generating the server differentials is: a computer system located within the server such that the server differential is pulled directly from the server to the client, or a computer system located within a differential server that is separate from the server such that the server differential is pulled directly from the differential server to the client.
- Claim:
5. The system of claim 1, wherein the server differential is created by storing a last modified date in each row of the server database, and sending the highest such current value as a cookie in server differentials, and wherein in subsequent pull requests, the server differential can by including in only such rows that have a higher last-modified date than the one provided in the cookie.
- Claim:
6. The system of claim 1, wherein the server differential is created by maintaining a global sequence number for the entire server database, and putting that sequence number as an additional attribute of each row of the server side database, and wherein the sequence number can then be modified on each change to the server-side database, and the sequence number can be included in the cookie returned in the server differential, and wherein a next server differential can then be calculated by returning only rows which have a sequence number higher than the provided.
- Claim:
7. The system of claim 1, wherein the server differential is created by associating a version identifier with each row in the server side database, and the version identifier can be an incrementing integer or a hash of the row of the content, or a randomly generated string, and wherein when returning a server differential to the client, the server can include a table of all keys plus their version identifiers as the cookie, and also when the pull requests happens, the server can use the table to find modified rows in the database.
- Claim:
8. The system of claim 1, wherein the client mutation IDs are generated as sequential integers corresponding to sequentially performed mutations.
- Claim:
9. The system of claim 1, wherein the client mutations and their associated mutation IDs are continuously pushed to the server without waiting for the server to respond to the client.
- Claim:
10. The system of claim 1, wherein the client is a web or mobile application.
- Claim:
11. The system of claim 1, wherein branches of the cache are removed from client system memory when the branches are no longer reachable.
- Claim:
12. The system of claim 11, where data no longer needed by a deleted branch is also removed.
- Claim:
13. The system of claim 1, wherein the server is an authoritative server that receives the client mutations from each of the N clients and then determines whether each of the received client mutations can be executed on the server, or whether to modify the mutation before executing it.
- Claim:
14. The system of claim 13, wherein the server executes each of the mutations sequentially, mapping the received mutations to the individual clients by the client ID and the client mutation ID.
- Claim:
15. The system of claim 13, wherein received client mutations that cannot be executed on the server are not applied for all of the N clients.
- Claim:
16. The system of claim 13, wherein received client mutations that can be executed on the server are applied in the same order across all of the N clients.
- Claim:
17. The system of claim 1, wherein the client mutations comprise a mutation name, a mutation ID and a mutation argument.
- Claim:
18. The system of claim 1, wherein the server differential is generated as a sequence of changes to the key/value pairs.
- Claim:
19. The system of claim 1, wherein a cookie is sent to the client with each server differential.
- Claim:
20. The system of claim 19, wherein the server differential generated for each of the N clients is calculated from the cookie sent to the particular client and the last client mutation ID received from that particular client.
- Claim:
21. The system of claim 1, wherein the server is an authoritative server and wherein: the server incorporates programming that represents each mutation name that is sent by clients, the incorporated programming decides whether to apply, modify, or reject each mutation, and the resulting changes to the server state are sent to each of the other N clients in the pulled server differentials, thereby updating each of the N clients.
- Claim:
22. The system of claim 1, wherein each of the N clients send their own mutations to the server without waiting to communicate with other clients.
- Claim:
23. The system of claim 1, wherein the server is synchronized to the N clients when the client mutations pushed to the server have been executed on the server.
- Claim:
24. A method of bi-directional synchronization between N clients and a server, comprising: (a) providing a computer system comprising N clients and a server; (b) for each of the N clients: (i) pushing mutations made in the client to the server, while simultaneously pushing client IDs and client mutation IDs for each mutation to the server; (ii) pulling server differentials to the client; (iii) storing key/value pairs in a versioned cache, wherein the keys are text strings and the values are data provided by an application in the client, (iii) storing historical versions of the key/value pairs in the versioned cache, (iv) applying a rebaser to resolve conflicts between the client and the server by: forking the cache to create a synch branch when the client receives the latest server differential, applying the latest received server differential to the synch branch, applying only those mutations to the synch branch that have not already been acknowledged by the server, and then making the synch branch the main branch of the cache.
- Claim:
25. The method of claim 24, further comprising: iteratively generating the server differentials by comparing snapshots of the server at consecutive periods of time.
- Claim:
26. The method of claim 24, wherein the client mutations and their associated mutation IDs are continuously pushed to the server without waiting for the server to respond to the client.
- Claim:
27. The method of claim 24, wherein the server is an authoritative server that receives the client mutations from each of the N clients and then determines whether each of the received client mutations can be executed on the server.
- Claim:
28. The method of claim 27, wherein the server executes each of the mutations sequentially, mapping the received mutations to the individual clients by the client ID and the client mutation ID.
- Claim:
29. The method of claim 24, wherein the server differential generated for each of the N clients is calculated from a cookie sent to the particular client and the last client mutation ID received from that particular client.
- Claim:
30. The method of claim 24, wherein the server selects the client mutations to analyze based upon the associated sequential mutation ID for each of the N clients such that the server analyzes the most recent successive mutation that has not previously been analyzed for each of the N clients.
- Claim:
31. The method of claim 24, wherein each of the N clients is synchronized to the server independently of the server being synchronized to each of the N clients such that server and client synchronization can be carried out over different periods of time.
- Current International Class:
04; 06
- Accession Number:
edspap.20220239737
No Comments.