# README
Tan
Tan is a high performance database for storing Raft log and metadata.
Motivation
Early versions of Dragonboat employed RocksDB style LSM based Key-Value databases to store Raft log and metadata. Such Key-Value stores are easy to use but such convenience comes at huge costs -
- redundant MemTables
- redundant keys
- redundant serializations
- storage amplification
- write amplification
- read amplification
- expensive concurrent access control
Tan aims to overcome all these issues by providing a specifically designed database for storing Raft log and metadata.
License
Tan contains Pebble code and code derived from Pebble. Pebble itself is built from the golang version of Level-DB. Pebble, Level-DB and the golang version of Level-DB are all BSD licensed.
# Functions
CreateLogMultiplexedTan creates and returns a tan instance that uses multiplexed log files.
CreateTan creates and return a regular tan instance.
IsInvalidRecord returns true if the error matches one of the error types returned for invalid records.
# Constants
MaxLogFileSize is the default max log file size.
MaxManifestFileSize is the default max manifest file size.
# Variables
ErrClosed is the error used to indicate that the db has already been closed.
ErrCRCMismatch is returned to indicate that CRC mismatch has been found.
ErrInvalidChunk is returned if a chunk is encountered with an invalid header, length, or checksum.
ErrNoBootstrap is the error used to indicate that there is no saved bootstrap record.
ErrNoLastRecord is returned if LastRecordOffset is called and there is no previous record.
ErrNoState is the error indicating that there is no state record in the db.
ErrNotAnIOSeeker is returned if the io.Reader underlying a Reader does not implement io.Seeker.
ErrZeroedChunk is returned if a chunk is encountered that is zeroed.
Factory is the default LogDB factory instance used for creating tan DB instances.
MultiplexedLogFactory is a LogDB factory instance used for creating an tan DB with multiplexed logs.