Code Monkey home page Code Monkey logo

memdb's Introduction

memdb

crates.io version build status downloads docs.rs docs

Thread-safe in-memory key-value store. Ideal for development and prototyping. Does not persist to disk.

Usage

let mut db = Memdb::open().await?;
db.set("beep", "boop").await?;
let val = db.get("beep").await?;
assert_eq!(val, Some("boop".as_bytes().to_owned()));
Ok(())

Installation

$ cargo add memdb

License

MIT OR Apache-2.0

memdb's People

Contributors

dependabot-preview[bot] avatar johntitor avatar k-nasa avatar yoshuawuyts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

memdb's Issues

Swapping RwLock<HashMap> to DHashMap from ccl

Feature request and tracking issue.

Currently the datastore is behind a RwLock'ed map. This is very slow.

The difference this improvement brings is swapping RwLock<HashMap> to DHashMap from ccl. ccl is a crate with the fastest general purpose concurrent map and is a drop-in replacement.

This is useful because it speeds up the code significantly without additional complexity.

If this is accepted I can perform the change and submit a PR.

New release needed

Any chance of making a new release containing the latest changes, specially this commit?

With the latest versions of the compiler it won't compile if imported the usual way

memdb = "1.0.0"

At the moment I'm importing this crate as below which isn't ideal

memdb = { git = "https://github.com/yoshuawuyts/memdb", rev = "cdad31e5bf3bd4f95174a269ae6d581a9a44203a" }

error: no such subcommand: `add`

Choose one: is this a ๐Ÿ› bug report

Expected Behavior

Current Behavior

The readme says:

Installation
$ cargo add memdb

but cargo says:

error: no such subcommand: `add`

	Did you mean `doc`?

$ cargo -vV
cargo 1.39.0-nightly (ab6fa8908 2019-09-25)
release: 1.39.0
commit-hash: ab6fa8908c9b6c8f7e2249231c395eebfbc49891
commit-date: 2019-09-25

Possible Solution

cargo install memdb ?

error: specified package `memdb v1.0.0` has no binaries

nope, guess that's not it.
Manually adding it to [dependencies] in Cargo.toml ?

Your Environment

Software Version(s)
Package ?
Runtime ?
Package Manager pacman
Operating System Arch Linux 64bit

[Q] How to print gotten value?

Choose one: this is a ๐Ÿ”ฆ question?

What's another way to do this assert_eq!(val, Some("boop".as_bytes().to_owned()));
by converting the val to the same/similar type that "boop" has? That line is from usage.

Or, in other words, how do you println! the gotten val?

let val = db.get("beep").await?;
//how to println! `val` here?

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.