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.
Installation
-
Add the dependency to your
shard.yml
:dependencies: bushdb: github: kebasyaty/bushdb version: ~> 0.6.10
-
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
License
This project is licensed under the MIT.
Changelog
Contributing
- Fork it (https://github.com/kebasyaty/bushdb/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- kebasyaty Gennady Kostyunin - creator and maintainer