clonetone, which is made with Golang, offers a user-friendly and easy-to-configure key-value store system with the following features:
- It incorporates an append log-based persistence system to ensure fast write operations.
- It automatically prunes data files to minimize disk usage.
- It is easily configurable, allowing users to adjust the size of each data file and the frequency of pruning.
- It supports several data persistence formats, including CSV, JSON(WIP), and Protobuf(WIP).
Compare with append to a csv file everytime when do set operation:
Read will be the same because both are from memory (use map to do index)
go get github.com/kadai0308/cleantone
package main
import (
"github.com/kadai0308/cleantone"
"log"
)
func main() {
dataPath := "FOLDER_PATH_YOU_WANT"
eachDataFileSize := 10 * cleantone.FileSize.MB
dataFileFormat := cleantone.DataFormat.CSV
config := cleantone.DBConfig{
RotateThreshold: eachDataFileSize,
DataPath: dataPath,
DataFormat: dataFileFormat,
}
DB := cleantone.NewDB(config)
// In order to persistence the data in memory,
// remember to call DB.Close() before func return
defer DB.Close()
_, err := DB.Get("haha")
if err != nil {
log.Fatal(err)
}
}
cleantone is under the Apache 2.0 license. See the LICENSE file for details.