summaryrefslogtreecommitdiffstats
path: root/services/cloudsync/docs/architecture.rst
blob: a7a8aa7ba812071047642ed413bc9efad8da9b9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.. _cloudsync_architecture:

============
Architecture
============

CloudSync offers functionality similar to Firefox Sync for data sources. Third-party addons
(sync adapters) consume local data, send and receive updates from the cloud, and merge remote data.


Files
=====

CloudSync.jsm
    Main module; Includes other modules and exposes them.

CloudSyncAdapters.jsm
    Provides an API for addons to register themselves. Will be used to
    list available adapters and to notify adapters when sync operations
    are requested manually by the user.

CloudSyncBookmarks.jsm
    Provides operations for interacting with bookmarks.

CloudSyncBookmarksFolderCache.jsm
    Implements a cache used to store folder hierarchy for filtering bookmark events.

CloudSyncEventSource.jsm
    Implements an event emitter. Used to provide addEventListener and removeEventListener
    for tabs and bookmarks.

CloudSyncLocal.jsm
    Provides information about the local device, such as name and a unique id.

CloudSyncPlacesWrapper.jsm
    Wraps parts of the Places API in promises. Some methods are implemented to be asynchronous
    where they are not in the places API.

CloudSyncTabs.jsm
    Provides operations for fetching local tabs and for populating the about:sync-tabs page.


Data Sources
============

CloudSync provides data for tabs and bookmarks. For tabs, local open pages can be enumerated and
remote tabs can be merged for displaying in about:sync-tabs. For bookmarks, updates are tracked
for a named folder (given by each adapter) and handled by callbacks registered using addEventListener,
and remote changes can be merged into the local database.

Versioning
==========

The API carries an integer version number (clouySync.version). Data records are versioned separately and individually.