summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 09:57:19 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 09:57:19 +0100
commit1259fa9eb1595c141fb80a643b8618cc9e4f6db9 (patch)
tree17f963d65f6c16c3c05a6c63a57d4440d30d95b4 /docs
parent47bfba0d9152a1f7f689d7936b107b1a899a0b76 (diff)
downloadsink-1259fa9eb1595c141fb80a643b8618cc9e4f6db9.tar.gz
sink-1259fa9eb1595c141fb80a643b8618cc9e4f6db9.zip
Documentation structure
Diffstat (limited to 'docs')
-rw-r--r--docs/design.md77
-rw-r--r--docs/designgoals.md39
-rw-r--r--docs/index.md27
-rw-r--r--docs/tradeoffs.md36
4 files changed, 92 insertions, 87 deletions
diff --git a/docs/design.md b/docs/design.md
index 4451b49..499f527 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -1,44 +1,7 @@
1# Design Goals
2## Axioms
31. Personal information is stored in multiple sources (address books, email stores, calendar files, ...)
42. These sources may local, remote or a mix of local and remote
5
6## Requirements
71. Local mirrors of these sources must be available to 1..N local clients simultaneously
82. Local clients must be able to make (or at least request) changes to the data in the local mirrors
93. Local mirrors must be usable without network, even if the source is remote
104. Local mirrors must be able to syncronoize local changes to their sources (local or remote)
115. Local mirrors must be able to syncronize remote changes and propagate those to local clients
126. Content must be searchable by a number of terms (dates, identities, body text ...)
137. This must all run with acceptable performance on a moderate consumer-grade desktop system
14
15Nice to haves:
16
171. As-close-to-zero-copy-as-possible for data
182. Simple change notification semantics
193. Resource-specific syncronization techniques
204. Data agnostic storage
21
22Immediate goals:
23
241. Ease development of new features in existing resources
252. Ease maintenance of existing resources
263. Make adding new resources easy
274. Make adding new types of data or data relations easy
285. Improve performance relative to existing Akonadi implementation
29
30Long-term goals:
31
321. Project view: given a query, show all items in all stores that match that query easily and quickly
33
34Implications of the above:
35
36* Local mirrors must support multi-reader, but are probably best served with single-writer semantics as this simplifies both local change recording as well as remote synchronization by keeping it in one process which can process write requests (local or remote) in sequential fashion.
37* There is no requirement for a central server if the readers can concurrently access the local mirror directly
38* A storage system which requires a schema (e.g. relational databases) are a poor fit given the desire for data agnosticism and low memory copying
39
40# Overview 1# Overview
41 2
3Sink is a data access layer that additionally handles synchronization with external sources and indexing of data for efficient queries.
4
42## Client API 5## Client API
43The client facing API hides all Sink internals from the applications and emulates a unified store that provides data through a standardized interface. 6The client facing API hides all Sink internals from the applications and emulates a unified store that provides data through a standardized interface.
44This allows applications to transparently use various data sources with various data source formats. 7This allows applications to transparently use various data sources with various data source formats.
@@ -63,39 +26,3 @@ The change replay is based on the revisions in the store. Clients (as well as al
63### Preprocessor pipeline 26### Preprocessor pipeline
64Each 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. 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.
65 28
66# Tradeoffs/Design Decisions
67* Key-Value store instead of relational
68 * `+` Schemaless, easier to evolve
69 * `-` No need to fully normalize the data in order to make it queriable. And without full normalization SQL is not really useful and bad performance wise.
70 * `-` We need to maintain our own indexes
71
72* Individual store per resource
73 * Storage format defined by resource individually
74 * `-` Each resource needs to define it's own schema
75 * `+` Resources can adjust storage format to map well on what it has to synchronize
76 * `+` Synchronization state can directly be embedded into messages
77 * `+` Individual resources could switch to another store technology
78 * `+` Easier maintenance
79 * `+` Resource is only responsible for it's own store and doesn't accidentaly break another resources store
80 * `-` Inter`-`resource moves are both more complicated and more expensive from a client perspective
81 * `+` Inter`-`resource moves become simple additions and removals from a resource perspective
82 * `-` No system`-`wide unique id per message (only resource/id tuple identifies a message uniquely)
83 * `+` Stores can work fully concurrently (also for writing)
84
85* Indexes defined and maintained by resources
86 * `-` Relational queries accross resources are expensive (depending on the query perhaps not even feasible)
87 * `-` Each resource needs to define it's own set of indexes
88 * `+` Flexible design as it allows to change indexes on a per resource level
89 * `+` Indexes can be optimized towards resources main usecases
90 * `+` Indexes can be shared with the source (IMAP serverside threading)
91
92* Shared domain types as common interface for client applications
93 * `-` yet another abstraction layer that requires translation to other layers and maintenance
94 * `+` decoupling of domain logic from data access
95 * `+` allows to evolve types according to needs (not coupled to specific application domain types)
96
97# Risks
98* key-value store does not perform with large amounts of data
99* query performance is not sufficient
100* turnaround time for modifications is too high to feel responsive
101* design turns out similarly complex as Akonadi
diff --git a/docs/designgoals.md b/docs/designgoals.md
new file mode 100644
index 0000000..4ffeeac
--- /dev/null
+++ b/docs/designgoals.md
@@ -0,0 +1,39 @@
1# Design Goals
2## Axioms
31. Personal information is stored in multiple sources (address books, email stores, calendar files, ...)
42. These sources may local, remote or a mix of local and remote
5
6## Requirements
71. Local mirrors of these sources must be available to 1..N local clients simultaneously
82. Local clients must be able to make (or at least request) changes to the data in the local mirrors
93. Local mirrors must be usable without network, even if the source is remote
104. Local mirrors must be able to syncronoize local changes to their sources (local or remote)
115. Local mirrors must be able to syncronize remote changes and propagate those to local clients
126. Content must be searchable by a number of terms (dates, identities, body text ...)
137. This must all run with acceptable performance on a moderate consumer-grade desktop system
14
15Nice to haves:
16
171. As-close-to-zero-copy-as-possible for data
182. Simple change notification semantics
193. Resource-specific syncronization techniques
204. Data agnostic storage
21
22Immediate goals:
23
241. Ease development of new features in existing resources
252. Ease maintenance of existing resources
263. Make adding new resources easy
274. Make adding new types of data or data relations easy
285. Improve performance relative to existing Akonadi implementation
29
30Long-term goals:
31
321. Project view: given a query, show all items in all stores that match that query easily and quickly
33
34Implications of the above:
35
36* Local mirrors must support multi-reader, but are probably best served with single-writer semantics as this simplifies both local change recording as well as remote synchronization by keeping it in one process which can process write requests (local or remote) in sequential fashion.
37* There is no requirement for a central server if the readers can concurrently access the local mirror directly
38* A storage system which requires a schema (e.g. relational databases) are a poor fit given the desire for data agnosticism and low memory copying
39
diff --git a/docs/index.md b/docs/index.md
index 3019cfd..36e309c 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,15 +1,18 @@
1# Index 1Sink is a data access layer handling synchronization, caching and indexing.
2* Design 2
3 * Design Goals 3Discussion of the code should be done on the kde-pim at kde.org mailing list
4 * Overview 4or in #kontact on IRC.
5 * Client API 5
6 * Storage 6Note that all feature development should happen in feature branches, and that
7 * Resource 7the mainline development branch is "develop". Master is for releases. It is
8 * Facade 8recommended (though not required) to use the "git flow" tools to make branched
9 * Logging 9development easy (and easy for others to coordinate with):
10* Extending Akoandi Next 10
11 * Steps to add support for new types 11 https://github.com/nvie/gitflow
12 * Steps for adding support for a type to a resource 12
13For further information see:
14
15 https://phabricator.kde.org/project/view/5/
13 16
14# Documentation 17# Documentation
15This documentation is built using [mkdocs.org](http://mkdocs.org). 18This documentation is built using [mkdocs.org](http://mkdocs.org).
diff --git a/docs/tradeoffs.md b/docs/tradeoffs.md
new file mode 100644
index 0000000..d0e32c1
--- /dev/null
+++ b/docs/tradeoffs.md
@@ -0,0 +1,36 @@
1# Tradeoffs/Design Decisions
2* Key-Value store instead of relational
3 * `+` Schemaless, easier to evolve
4 * `-` No need to fully normalize the data in order to make it queriable. And without full normalization SQL is not really useful and bad performance wise.
5 * `-` We need to maintain our own indexes
6
7* Individual store per resource
8 * Storage format defined by resource individually
9 * `-` Each resource needs to define it's own schema
10 * `+` Resources can adjust storage format to map well on what it has to synchronize
11 * `+` Synchronization state can directly be embedded into messages
12 * `+` Individual resources could switch to another store technology
13 * `+` Easier maintenance
14 * `+` Resource is only responsible for it's own store and doesn't accidentaly break another resources store
15 * `-` Inter`-`resource moves are both more complicated and more expensive from a client perspective
16 * `+` Inter`-`resource moves become simple additions and removals from a resource perspective
17 * `-` No system`-`wide unique id per message (only resource/id tuple identifies a message uniquely)
18 * `+` Stores can work fully concurrently (also for writing)
19
20* Indexes defined and maintained by resources
21 * `-` Relational queries accross resources are expensive (depending on the query perhaps not even feasible)
22 * `-` Each resource needs to define it's own set of indexes
23 * `+` Flexible design as it allows to change indexes on a per resource level
24 * `+` Indexes can be optimized towards resources main usecases
25 * `+` Indexes can be shared with the source (IMAP serverside threading)
26
27* Shared domain types as common interface for client applications
28 * `-` yet another abstraction layer that requires translation to other layers and maintenance
29 * `+` decoupling of domain logic from data access
30 * `+` allows to evolve types according to needs (not coupled to specific application domain types)
31
32# Risks
33* key-value store does not perform with large amounts of data
34* query performance is not sufficient
35* turnaround time for modifications is too high to feel responsive
36* design turns out similarly complex as Akonadi