flydb

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

FlyDB-logo

GitHub top language Go Reference LICENSE GitHub stars GitHub forks Go Report Card

The project is under iterative development, please do not use it in production environment!

English | 中文

FlyDB aims to serve as an alternative to in-memory key-value storage (such as Redis) in some cases, aiming to strike a balance between performance and storage cost. It does this by optimizing resource allocation and using cost-effective storage media. By intelligently managing data, FlyDB ensures efficient operations while minimizing storage costs. It provides a reliable solution for scenarios that require a balance between performance and storage costs.

👋 What is FlyDB ?

FlyDB is a high-performance key-value (KV) storage engine based on the efficient bitcask model. It offers fast and reliable data retrieval and storage capabilities. By leveraging the simplicity and effectiveness of the bitcask model, FlyDB ensures efficient read and write operations, resulting in improved overall performance. It provides a streamlined approach to storing and accessing key-value pairs, making it an excellent choice for scenarios that require fast and responsive data access. FlyDB's focus on speed and simplicity makes it a valuable alternative for applications that prioritize performance while balancing storage costs.

🏁 Fast Start: FlyDB

You can install FlyDB using the Go command line tool:

go get github.com/ByteStorage/flydb

Or clone this project from github:

git clone https://github.com/ByteStorage/flydb

🚀 How to use FlyDB ?

Here is a simple example of how to use the Linux version:

See flydb/examples for details.

package main

import (
	"fmt"
	"github.com/ByteStorage/flydb"
)

func main() {
    	options := flydb.DefaultOptions
	options.DirPath = "/tmp/flydb"
	db, _ := flydb.NewFlyDB(options)

    	err := db.Put([]byte("name"), []byte("flydb-example"))
    	if err != nil {
        	fmt.Println("Put Error => ", err)
    	}


	val, err := db.Get([]byte("name"))
	if err != nil {
		fmt.Println("Get Error => ", err)
	}
    	fmt.Println("name value => ", string(val))
    
    
    	err := db.Delete([]byte("name"))
    	if err != nil {
        	fmt.Println("Delete Error => ", err)
    	}
}

🔮 How to contact us ?

If you have any questions and want to contact us, you can contact our developer team, we will reply to your email:

Team Email: bytestorage@163.com

Or add my wechat, invite you to enter the project community, and code masters together to exchange learning.

Add wechat please comment GIthub

vx

📜 TODO List

  • Extended data structure support: including but not limited to string, list, hash, set, etc.
  • Compatible with Redis protocols and commands.
  • Support http services.
  • Support tcp services.
  • Log aggregation
  • Data backup
  • Distributed cluster model.

How to contribute ?

If you have any ideas or suggestions for FlyDB, please feel free to submit 'issues' or' pr 'on GitHub. We welcome your contributions!

Please refer to the complete specification procedure:CONTRIBUTEING

Licence

FlyDB is released under the Apache license. For details, see LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyIsEmpty             = errors.New("KeyEmptyError : the key is empty")
	ErrIndexUpdateFailed      = errors.New("IndexUpdateFailError : failed to update index")
	ErrKeyNotFound            = errors.New("KeyNotFoundError : key is not found in database")
	ErrDataFailNotFound       = errors.New("DataFailNotFoundError : data file is not found")
	ErrDataDirectoryCorrupted = errors.New("DataDirectoryCorruptedError : the databases directory maybe corrupted")
	ErrExceedMaxBatchNum      = errors.New("ExceedMaxBatchNumError : exceed the max batch num")
	ErrMergeIsProgress        = errors.New("MergeIsProgressError : merge is in progress, try again later")

	ErrOptionDirPathIsEmpty          = errors.New("OptionDirPathError : database dir path is empty")
	ErrOptionDataFileSizeNotPositive = errors.New("OptionDataFileSizeError : database data file size must be greater than 0")
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
lib
wal
protocol
sync
tcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL