summaryrefslogtreecommitdiffstats
path: root/docs/design.md
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 15:38:45 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 15:38:45 +0100
commitb8200434209c317ebc4883b9f87513991bae33e3 (patch)
tree00164031c5b39eec7a5969289de21651d328d038 /docs/design.md
parent0376079b862cf38973a59336f3843bca2788c576 (diff)
downloadsink-b8200434209c317ebc4883b9f87513991bae33e3.tar.gz
sink-b8200434209c317ebc4883b9f87513991bae33e3.zip
Documentation
Diffstat (limited to 'docs/design.md')
-rw-r--r--docs/design.md27
1 files changed, 22 insertions, 5 deletions
diff --git a/docs/design.md b/docs/design.md
index 499f527..9b64056 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -9,20 +9,37 @@ This allows applications to transparently use various data sources with various
9## Resource 9## Resource
10A resource is a plugin that provides access to an additional source. It consists of a store, a synchronizer process that executes synchronization & change replay to the source and maintains the store, as well as a facade plugin for the client api. 10A resource is a plugin that provides access to an additional source. It consists of a store, a synchronizer process that executes synchronization & change replay to the source and maintains the store, as well as a facade plugin for the client api.
11 11
12## Store 12## Store / Indexes
13Each resource maintains a store that can either store the full dataset for offline access or only metadata for quick lookups. Resources can define how data is stored. 13Each resource maintains a store that can either store the full dataset for offline access or only metadata for quick lookups. Resources can define how data is stored.
14The store consits of revisions with every revision containing one entity.
15
16The store additionally contains various secondary indexes for efficient lookups.
14 17
15## Types 18## Types
16### Domain Type 19### Domain Type
17The domain types exposed in the public interface. 20The domain types exposed in the public interface provide standardized access to the store. The domain types and their properties directly define the granularity of data retrieval and thus also what queries can be executed.
18 21
19### Buffer Type 22### Buffer Type
20The individual buffer types as specified by the resource. The are internal types that don't necessarily have a 1:1 mapping to the domain types, although that is the default case that the default implementations expect. 23The buffers used by the resources in the store may be different from resource to resource, and don't necessarily have a 1:1 mapping to the domain types.
24This allows resources to store data in a way that is convenient/efficient for synchronization, altough it may require a bit more effort when accessing the data.
25The individual buffer types are specified by the resource and internal to it. Default buffer types exist of all domain types.
26
27### Commands
28Commands are used to modify the store. The resource processes commands that are generated by clients and the synchronizer.
29
30### Notifications
31The resource emits notifications to inform clients of new revisions and other changes.
21 32
22## Mechanisms 33## Mechanisms
23### Change Replay 34### Change Replay
24The change replay is based on the revisions in the store. Clients (as well as also the write-back mechanism that replays changes to the source), are informed that a new revision is available. Each client can then go through all new revisions (starting from the last seen revision), and thus update its state to the latest revision. 35The change replay is based on the revisions in the store. Clients (as well as also the write-back mechanism that replays changes to the source), are informed that a new revision is available. Each client can then go through all new revisions (starting from the last seen revision), and thus update its state to the latest revision.
25 36
26### Preprocessor pipeline 37### Synchronization
27Each resource has an internal pipeline of preprocessors that can be used for tasks such as indexing or filtering. The pipeline guarantees that the preprocessor steps are executed before the entity is persisted. 38The synchronizer executes a periodic synchronization that results in change commands to synchronize the store with the source.
39The change-replay mechanism is used to write back changes to the source that happened locally.
40
41### Command processing
42The resources have an internal persitant command queue hat is populated by the synchronizer and clients continuously processed.
43
44Each resource has an internal pipeline of preprocessors that can be used for tasks such as indexing or filtering, and through which every command goes before it enters the store. The pipeline guarantees that the preprocessor steps are executed on any command before the entity is persisted.
28 45