Payloads: client side VS server side diffing - aecdeltas/aec-deltas-spec GitHub Wiki
As explained in the Delta container specification, transfer of data happens always through a Delta payload.
However, the diff
field of the Delta payload might:
- Have all three properties present (
toBeCreated
,toBeUpdated
,toBeDeleted
) - we call this diff-based Delta payload. - Have only the first property present (
toBeCreated
) - we call this revision-based Delta payload.
Download/upload of a revision-based Delta payload is generally envisioned to happen only when:
For example, an user starts working on a model for the first time, while somebody else already worked on it on other machines.
The user will need to to download the entire model at its latest revision.
If a client created a model brand new (first revision) and wants to send it to the server so it's recorded in a new stream, the user will have to upload the entire revision.
This can happen only if a client has downloaded only a part of a revision, for example through a query, and then modified that part. They now want a new revision to be saved on the server based on this.
The previous revision would have to be compared in its entirety with this client-side changes, because it is not possible to tell if the client's modifications on their queried objects did not affect other parts of the building.
This means that the the cost of the diffing will likely be large (the previous revision to be compared with the current changes might be large). Performing the diffing on the client side would take long for two reasons:
- the client would have to download the previous revision (big download)
- the client would have to perform the diffing on a big model (slow computation)
In this case, the client might wish to upload all the objects he possess and let the server do the diffing.
In all these cases, uploading an entire revision on a Server stream when there is already a previous revision means that the Server will have to take care of the diffing. See Payloads types: client side VS server side diffing