bushDB

bushDB is a fast key-value storage library that provides an ordered mapping from string keys to string values.
The library uses fractal-tree addressing.
The maximum size of the database is 16**32=340282366920938463463374607431768211456 branches, each branch can store one or more keys.
The value of any key can be obtained in 32 steps, thereby achieving high performance.
There is no need to iterate through all the keys in search of the desired value.

CI Docs Crystal GitHub release GitHub license GitHub repository

Status Project

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      bushdb:
        github: kebasyaty/bushdb
        version: ~> 0.6.10
  2. Run shards install

Usage

require "bushdb"

# Create DB
db : BushDB::DB = BushDB::DB.new

# Set, get, delete
db.set("key name", "Some text")
db.get("key name") # => "Some text"
db.has?("key name") # => true
#
db.delete("key name")
#
# If the key has been deleted.
db.get("key name") # => nil
db.has?("key name") # => false

# Delete the database directory with all the keys in it.
db.clear

# Delete the root directory with all databases in it.
db.napalm

Contributing

  1. Fork it (https://github.com/kebasyaty/bushdb/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Changelog

View the change history.

License

This project is licensed under the MIT.