CloudServices/Sync/FxSync/StoreRedesign: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
== Proposal ==
== Proposal ==


Reduce to two classes: ''Store'' and ''Engine''. ''Store''s are both sinks and sources of records; ''Engine''s exist (from one perspective, at least) to reify the relationship between two Stores (including tracking <tt>lastSync</tt>), which in practice means connecting a pair of stores as source then sink in turn.
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.


Stores 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 ''FxBookmarkStore'' layer above Places, a ''ServerBookmarkStore'' layer in front of the v5/v1.1 Sync API, and connect the two with a simple Engine. Both Store implementations would implement ''exactly the same interface'', which would allow us to trivially implement:
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 Store interface and wrap another Store) can be used to implement:
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 Stores in terms of deltas, but maintain storage version compatibility by translation into full objects.
* Storage item translation: e.g., define Repository in terms of deltas, but maintain storage version compatibility by translation into full objects.


== API ==
== API ==
canmove, Confirmed users
725

edits

Navigation menu