You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This non-breaking change introduces the concept of "Milestone
Snapshots". A milestone snapshot is a snapshot of a document for a given
version, which is persisted in the database. The purpose of this is to
speed up the `Backend.fetchSnapshot` method, which currently has to
fetch all the ops required to build a snapshot from v0. Instead,
`fetchSnapshot` can now fetch the most recent, relevant milestone
snapshot and build on top of that with fewer ops.
In order to do this, the database adapter API has been updated to
include two new methods:
- `saveMilestoneSnapshot(collection, snapshot, callback): void;` stores
the provided snapshot against the collection
- `getMilestoneSnapshot(collection, id, version, callback): void`
fetches the most recent snapshot whose version is equal to or less
than the provided `version` (or the most recent version if version is
`null`, in keeping with the `to` argument in `getOps`).
The adapter also has the responsibility of saving the appropriate
milestone snapshots when a new op is committed.
0 commit comments