Prev: jdbc Next: memory-management
Access to disk drives can be slow. To improve access speeds, disks might contain volatile caches, which may not be durable memory. Writes are persisted in the cache before the SSD.
A few ways to improve latency are:
Disk Striping: using multiple disk drives, with a controller that handles distributing writes to the n disks it controls.
Reliability can be improved by mirroring writes to disks, so changes are persisted more than once.
To reduce the memory requirement, parity blocks can be recorded instead.
All of these methods can be combined in RAID.
The SimpleDB file manager stores data in pages, and owned by a File Manager.
A block, or a part of a page that has data written to it, is encapsulated in a block.
There are three implementations:
struct BlockId {
: String;
filename: i32;
blknum}
struct Page {
: Vec<u8>,
bb}
struct FileMgr {
: File,
db_directory: i32,
block_size: bool,
is_new: HashMap<String, File>,
open_files}
Prev: jdbc Next: memory-management