Skip to content

mngharbi/memstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memstore Travis CI Build Status Coverage license

Memstore is an in-memory, thread safe, multiple-key datastore for Go.

Overview

The datastore is built on top of multiple Left-Leaning Red-Black trees.

It allows you to store a collection of any arbitrary Go language structures, as long as you define a method to define comparison for arbitrary indexes.

It provides a way to get ranges based on any index in O(k + log n) time, k being the number of elements retrieved, and n being the number of structures in the datastore.

Also, getting minimum and maximum values based on any index defined runs O(log n).

All methods exported are thread safe, and enable multiple readers through a native Read Write Lock.

It's meant for use as a light-weight, efficient in-memory datastore as part of your Go package. If you want to persist data or advanced features (transactions, detailed search...etc), this may not not be ideal.

Installation

With a healthy Go Language installed, simply run go get github.com/mngharbi/memstore

Dependency

This package depends on GoLLRB, built by Petar Maymounkov.

However, I had to patch it to leverage it for this package. So, this package technically depends on the forked version.

About

In-memory go-routine safe multiple-key datastore for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages