summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-10-29 13:02:19 +0100
committerLinus Nordberg <linus@nordberg.se>2014-11-18 01:41:31 +0100
commitce07eb3da38afce436615faf56c919e50720d8c3 (patch)
treee485372e658814293dd78330a74c194f211ded5e
parentd86483fc4b3fda70b6e342d0aa1c0fa49d7b6943 (diff)
Add more db documentation.
-rw-r--r--doc/db.md38
1 files changed, 37 insertions, 1 deletions
diff --git a/doc/db.md b/doc/db.md
index 79ff9ac..7a411d1 100644
--- a/doc/db.md
+++ b/doc/db.md
@@ -17,7 +17,39 @@ Data entries are stored together with three attributes:
- leaf hash
hash over specific parts of the entry, usually together with a
- timestamp, for use in a merkle tree
+ timestamp for use in a merkle tree
+
+## Storage in a file system
+
+Two files (catlfish names in parentheses):
+
+- treesize (treesize)
+
+ filename is static, contains one line -- the number of entries in
+ the database
+
+- index (index)
+
+ filename is static, contains one line per entry -- the leafhash
+
+Three directories, "bucketed" in three levels, one file per database
+entry:
+
+- entry (certentries)
+
+ filename=leafhash, content=the actual data of the entry
+
+- entryhash (entryhash)
+
+ filename=entryhash, content=leafhash
+
+- indexforhash (certindex)
+
+ filename=leafhash, content=index
+
+## Distributed
+
+TODO: describe distribution
## Erlang code in src/
@@ -31,6 +63,10 @@ Data entries are stored together with three attributes:
file-based storage for ordered append-only lists of fixed-sized
entries, retrievable by index
+- perm.erl
+
+ reading and writing of files
+
- atomic.erl
atomic file operations