Code Monkey home page Code Monkey logo

memstore's Introduction

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.

memstore's People

Contributors

mngharbi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.