diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-10-28 13:45:50 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-11-18 01:41:31 +0100 |
commit | d86483fc4b3fda70b6e342d0aa1c0fa49d7b6943 (patch) | |
tree | 135d862f8cf68717cae618cab517d2919a4f04d9 /doc/db.md | |
parent | 4a48f6820bd2ef841de148564f7c11de0bb96356 (diff) |
Database documentation, first cut.
Diffstat (limited to 'doc/db.md')
-rw-r--r-- | doc/db.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/db.md b/doc/db.md new file mode 100644 index 0000000..79ff9ac --- /dev/null +++ b/doc/db.md @@ -0,0 +1,59 @@ +# plop database + +The plop database is a distributed, single-master, append-only +database suitable for transparency systems like Certificate +Transparency. + +Data entries are stored together with three attributes: + +- index + + the first entry in a database has index 0, the next 1 and so on + +- entry hash + + the hash over the entry, used for duplicate detection + +- leaf hash + + hash over specific parts of the entry, usually together with a + timestamp, for use in a merkle tree + +## Erlang code in src/ + +- db.erl + + public interface for adding entries and getting entries by index, + leaf hash and entry hash + +- index.erl + + file-based storage for ordered append-only lists of fixed-sized + entries, retrievable by index + +- atomic.erl + + atomic file operations + +- util.erl + + helper functions for lower level file handling + +- fsyncport.erl + + interface to C implementation for fsync(2) syscall + +## C code in c_src/ + +- net_read_write.c + + read and write to/from a file descriptor, using fsync(2) to increase + probability that data lands on disk + +- fsynchelper.c + + erlang port for net_read_write + +- erlport.c + + glue |