canmove, Confirmed users
725
edits
No edit summary |
|||
Line 3: | Line 3: | ||
== Proposal == | == Proposal == | ||
Reduce to two classes: '' | Reduce to two classes: ''Repository'' and ''Synchronizer'': | ||
* ''Repositories'' are both sinks and sources of records | |||
* ''Synchronizers'' exist (from one perspective, at least) to reify the relationship between two Repositories (including tracking <tt>lastSync</tt>), which in practice means connecting a pair of repositories as source then sink in turn. | |||
Repositories are entirely responsible for providing a timestamp- and record-centric API over a source of data. This interface abstracts the tracking of changed items and application and retrieval of records, and is uniform across both remote and local storage. For example, we would build a ''FxBookmarkRepository'' layer above Places, a ''ServerRepository'' layer in front of the v5/v1.1 Sync API, and connect the two with a simple Synchronizer. Both Repository implementations would implement ''exactly the same interface'', which would allow us to trivially implement: | |||
* Direct sync between two devices, without a server intermediary | * Direct sync between two devices, without a server intermediary | ||
Line 12: | Line 14: | ||
* Sync to multiple destinations | * Sync to multiple destinations | ||
Furthermore, ''middleware'' (classes that implement the | Furthermore, ''middleware'' (classes that implement the Repository interface and wrap another Repository) can be used to implement: | ||
* Encryption: consume and emit encrypted WBOs; pass decrypted WBOs to the inner store; implement crypto recovery (key refetches) | * Encryption: consume and emit encrypted WBOs; pass decrypted WBOs to the inner store; implement crypto recovery (key refetches) | ||
* Archiving, logging, etc. | * Archiving, logging, etc. | ||
* Version translation, giving Sync multiple version support | * Version translation, giving Sync multiple version support | ||
* Storage item translation: e.g., define | * Storage item translation: e.g., define Repository in terms of deltas, but maintain storage version compatibility by translation into full objects. | ||
== API == | == API == |