summaryrefslogtreecommitdiffstats
path: root/docs/storage.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/storage.md')
-rw-r--r--docs/storage.md23
1 files changed, 5 insertions, 18 deletions
diff --git a/docs/storage.md b/docs/storage.md
index 4852131..afd55d8 100644
--- a/docs/storage.md
+++ b/docs/storage.md
@@ -1,17 +1,3 @@
1## Store access
2Access to the entities happens through a well defined interface that defines a property-map for each supported domain type. A property map could look like:
3```
4Event {
5 startDate: QDateTime
6 subject: QString
7 ...
8}
9```
10
11This property map can be freely extended with new properties for various features. It shouldn't adhere to any external specification and exists solely to define how to access the data.
12
13Clients will map these properties to the values of their domain object implementations, and resources will map the properties to the values in their buffers.
14
15## Storage Model 1## Storage Model
16The storage model is simple: 2The storage model is simple:
17``` 3```
@@ -42,8 +28,7 @@ Each entity can be as normalized/denormalized as useful. It is not necessary to
42 28
43Denormalized: 29Denormalized:
44 30
45* priority is that mime message stays intact (signatures/encryption) 31* priority is that the mime message stays intact (signatures/encryption)
46* could we still provide a streaming api for attachments?
47 32
48``` 33```
49Mail { 34Mail {
@@ -55,7 +40,7 @@ Mail {
55Normalized: 40Normalized:
56 41
57* priority is that we can access individual members efficiently. 42* priority is that we can access individual members efficiently.
58* we don't care about exact reproducability of e.g. ical file 43* we don't care about exact reproducability of e.g. an ical file
59``` 44```
60Event { 45Event {
61 id 46 id
@@ -101,7 +86,7 @@ The resource can be effectively removed from disk (besides configuration),
101by deleting the directories matching `$RESOURCE_IDENTIFIER*` and everything they contain. 86by deleting the directories matching `$RESOURCE_IDENTIFIER*` and everything they contain.
102 87
103#### Design Considerations 88#### Design Considerations
104* The stores are split by buffertype, so a full scan (which is done by type), doesn't require filtering by type first. The downside is that an additional lookup is required to get from revision to the data. 89The stores are split by buffertype, so a full scan (which is done by type), doesn't require filtering by type first. The downside is that an additional lookup is required to get from revision to the data.
105 90
106### Revisions 91### Revisions
107Every operation (create/delete/modify), leads to a new revision. The revision is an ever increasing number for the complete store. 92Every operation (create/delete/modify), leads to a new revision. The revision is an ever increasing number for the complete store.
@@ -167,6 +152,8 @@ Using regular files as the interface has the advantages:
167The copy is necessary to guarantee that the file remains for the client/resource even if the resource removes the file on it's side as part of a sync. 152The copy is necessary to guarantee that the file remains for the client/resource even if the resource removes the file on it's side as part of a sync.
168The copy could be optimized by using hardlinks, which is not a portable solution though. For some next-gen copy-on-write filesystems copying is a very cheap operation. 153The copy could be optimized by using hardlinks, which is not a portable solution though. For some next-gen copy-on-write filesystems copying is a very cheap operation.
169 154
155A downside of having a file based design is that it's not possible to directly stream from a remote resource i.e. into the application memory, it always has to go via a file.
156
170## Database choice 157## Database choice
171By design we're interested in key-value stores or perhaps document databases. This is because a fixed schema is not useful for this design, which makes 158By design we're interested in key-value stores or perhaps document databases. This is because a fixed schema is not useful for this design, which makes
172SQL not very useful (it would just be a very slow key-value store). While document databases would allow for indexes on certain properties (which is something we need), we did not yet find any contenders that looked like they would be useful for this system. 159SQL not very useful (it would just be a very slow key-value store). While document databases would allow for indexes on certain properties (which is something we need), we did not yet find any contenders that looked like they would be useful for this system.