source: box/trunk/docs/api-notes/bin_bbstored.txt @ 2478

Revision 2478, 2.4 KB checked in by chris, 3 years ago (diff)

Rearrangement of api-notes directory.

  • Property svn:eol-style set to native
Line 
1TITLE bin/bbstored
2
3The backup store daemon.
4
5Maintains a store of encrypted files, and every so often goes through deleting unnecessary data.
6
7Uses an implementation of Protocol to communicate with the backup client daemon. See bin/bbstored/backupprotocol.txt for details.
8
9
10SUBTITLE Data storage
11
12The data is arranged as a set of objects within a RaidFile disc set. Each object has a 64 bit object ID, which is turned into a filename in a mildly complex manner which ensure that directories don't have too many objects in them, but there is a minimal number of nested directories. See StoreStructure::MakeObjectFilename in lib/backupstore/StoreStructure.cpp for more details.
13
14An object can be a directory or a file. Directories contain files and other directories.
15
16Files in directories are supersceded by new versions when uploaded, but the old versions are flagged as such. A new version has a different object ID to the old version.
17
18Every so often, a housekeeping process works out what can be deleted, and deletes unnecessary files to take them below the storage limits set in the store info file.
19
20
21SUBTITLE Note about file storage and downloading
22
23There's one slight entertainment to file storage, in that the format of the file streamed depends on whether it's being downloaded or uploaded.
24
25The problem is that it contains an index of all the blocks. For efficiency in managing these blocks, they all need to be in the same place.
26
27Files are encoded and decoded as they are streamed to and from the server. With encoding, the index is only completely known at the end of the process, so it's sent last, and lives in the filesystem last.
28
29When it's downloaded, it can't be decoded without knowing the index. So the index is sent first, followed by the data.
30
31
32SUBTITLE BackupContext
33
34The context of the current connection, and the object which modifies the store.
35
36Maintains a cache of directories, to avoid reading them continuously, and keeps a track of a BackupStoreInfo object which is written back periodiocally.
37
38
39SUBTITLE BackupStoreDaemon
40
41A ServerTLS daemon which forks off a separate housekeeping process as it starts up.
42
43Handling connections is delegated to a Protocol implementation.
44
45
46SUBTITLE BackupCommands.cpp
47
48Implementation of all the commands. Work which requires writing is handled in the context, read only commands mainly in this file.
49
50
51SUBTITLE HousekeepStoreAccount
52
53A class which performs housekeeping on a single account.
54
Note: See TracBrowser for help on using the repository browser.