]> Sergey Matveev's repositories - public-inbox.git/blob - Documentation/lei_design_notes.txt
b5180374ad0599f76f47b60890e43c00f34a6247
[public-inbox.git] / Documentation / lei_design_notes.txt
1 lei design notes
2 ----------------
3
4 Daemon architecture
5 -------------------
6
7 The use of a persistent daemon works around slow startup time of
8 Perl.  This is especially important for built-in support for
9 shell completion.  It attempts to support inotify and EVFILT_VNODE
10 background monitoring of Maildir keyword changes.
11
12 If lei were reimplemented in a language with faster startup
13 time, the daemon architecture would likely remain since it also
14 lets us easily decouple the local storage from slow IMAP/NNTP
15 backends and allow us to serialize writes to git-fast-import,
16 SQLite, and Xapian across multiple processes.
17
18 The coupling of IMAP and NNTP network latency to local storage
19 is a current weakness of public-inbox-watch.  Therefore, -watch
20 will likely adopt the daemon architecture of lei in the future.
21
22 Read/write vs read-only storage
23 -------------------------------
24
25 public-inboxes are intended to be written and read by different
26 Unix users.  Commonly, a single Unix user or group will write to
27 a public-inbox, but the inbox will be served by a user with
28 read-only permissions (e.g. "www-data" or "nobody").
29
30 lei/store is intended to be read and written by a single user,
31 thus we can rely on the Write-Ahead-Log journal of SQLite to
32 improve performance: <https://sqlite.org/wal.html>