From ce07eb3da38afce436615faf56c919e50720d8c3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 29 Oct 2014 13:02:19 +0100 Subject: Add more db documentation. --- doc/db.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'doc/db.md') 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 -- cgit v1.1