Documentation ¶
Index ¶
- type DB
- func (db *DB) Clean()
- func (db *DB) Close() error
- func (db *DB) Delete(key []byte) error
- func (db *DB) Fold(f func(key []byte, value []byte) bool) error
- func (db *DB) Get(key []byte) ([]byte, error)
- func (db *DB) GetListKeys() [][]byte
- func (db *DB) Merge() error
- func (db *DB) NewIterator(opt config.IteratorOptions) *Iterator
- func (db *DB) NewWriteBatch(opt config.WriteBatchOptions) *WriteBatch
- func (db *DB) Put(key []byte, value []byte) error
- func (db *DB) Sync() error
- type Iterator
- type WriteBatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents a FlyDB database instance, a high-performance storage engine built on the bitcask model. FlyDB utilizes a log-structured storage approach, which optimizes data operations by efficiently managing writes, reads, and deletes.
FlyDB shines in its ability to swiftly handle data operations, offering exceptional performance. With just a single disk IO, FlyDB completes each operation efficiently, resulting in lightning-fast response times.
One of the standout features of FlyDB is its efficient memory utilization. It employs an in-memory index that stores key-value mappings, facilitating rapid data access. This indexing mechanism enables FlyDB bto quickly locate data within the storage structure. However, it's important to note that the total size of data that can be stored is limited by the available memory capacity.
When your system's memory can accommodate a significant portion of the key-value pairs, FlyDB emerges as an excellent choice of storage engine. It not only delivers outstanding speed and responsiveness but also minimizes disk IO overhead, allowing for seamless data operations.
FlyDB's design philosophy revolves around balancing performance and memory usage. By optimizing disk IO and leveraging in-memory indexing, FlyDB provides a powerful and efficient storage solution for applications that prioritize speed and responsiveness.
func (*DB) Clean ¶ added in v1.0.6
func (db *DB) Clean()
Clean the DB data directory after the test is complete
func (*DB) Fold ¶
Fold get all the data and perform the operation specified by the user. The function returns false to exit
func (*DB) GetListKeys ¶
GetListKeys Gets all the keys in the database
func (*DB) NewIterator ¶
func (db *DB) NewIterator(opt config.IteratorOptions) *Iterator
NewIterator Initializes the iterator
func (*DB) NewWriteBatch ¶
func (db *DB) NewWriteBatch(opt config.WriteBatchOptions) *WriteBatch
NewWriteBatch Init WriteBatch
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator iterator
type WriteBatch ¶
type WriteBatch struct {
// contains filtered or unexported fields
}
WriteBatch Writes data in atomic batches to ensure atomicity
func (*WriteBatch) Commit ¶
func (wb *WriteBatch) Commit() error
Commit The transaction commits, writes the transient data to the data file, and updates the in-memory index
func (*WriteBatch) Delete ¶
func (wb *WriteBatch) Delete(key []byte) error
Delete Batch deletion of data