A Key-Value store to explore on database and storage internals in Golang.
A key–value database, or key–value store, is a data storage paradigm designed for storing
, retrieving
, and managing
associative arrays, and a data structure more commonly known today as a dictionary or hash table.
Dictionaries contain a collection of objects, or records, which in turn have different fields within them, each containing data.
These records are stored and retrieved using a key that uniquely identifies the record, and is used to find the data within the database.
This key-value store is a small version of a database. The inspiration for this project has been taken from the book
Introduction to Algorithms popularly
know as CLRS
. The objective is to design a configurable key-value
store having different implementations for each of the data
structure listed below:
- B Tree
- B+ Tree
- Skip List
Database tuples will be stored in main memory
as well as disk
depending upon the implementation of the data structure.
Tuples are being stored in main memory for quick access
and in the disk to add some sort of persistance
to the database.
For the user to consume this, he needs to pass a config object
based on which the data structure for the store
will be chosen.
- Insert a
key-value
pair into the store - Retrieve
value
for a particularkey
from the store - Remove a
key-value
pair from the store
Get(key interface{}) (interface{}, error)
Parameter | Type | Description |
---|---|---|
key |
interface{} |
Required. Unique key associated with the value |
Store(key interface{}, value interface{}) error
Parameter | Type | Description |
---|---|---|
key |
interface{} |
Required. Key to be inserted into the store |
value |
interface{} |
Required. Value associated with the given key |
Delete(key interface{}) error
Parameter | Type | Description |
---|---|---|
key |
interface{} |
Required. Unique key associated with the value |
Using devourKV
is easy. First, use go get to install the latest version of the library.
go get -u github.com/DevourTech/devourKV
This command will install devourKV
along with the library and its dependencies.
Next, include devourKV in your application:
import "github.com/DevourTech/devourKV/apis"
Consider versions released only on the master
branch as stable. The one's released on develop branch are mere snapshots and they do not guarantee stability.
Snapshots are released using a GitHub action called Snapshotter.
Contributions are always welcome!
Refer CONTRIBUTING.md for ways to get started.