NoSQL embedded database on top of RocksDB.
Documents: https://docs.rs/simpledb
Add this to your Cargo.toml
:
toml
[dependencies]
simpledb = "0.1"
Example:
```rust use simpledb::Database;
fn main() { // open a database let db = Database::open("./target/path/to/database").unwrap(); // left push a value to a list db.listleftpush("key", "value".as_bytes()).unwrap(); } ```
map_
prefix: get
, put
, delete
, count
, for_each
, items
.set_
prefix: add
, is_member
, delete
, count
, for_each
, items
.list_
prefix: left_push
, left_pop
, right_push
, right_pop
, count
, for_each
, items
.sorted_list_
prefix: add
, left_pop
, right_pop
, count
, for_each
, items
.sorted_set_
prefix: add
, is_member
, delete
, left
, right
, for_each
, items
.sorted list
and sorted set
is list
allow the same members, set
does not allow the same members.Example codes from benchmark
directory.
method | write | op/s ----------------------|------------|---------- mapput | yes | 62,539 mapget | | 355,871 mapcount | | 735,294 mapdelete | yes | 62,656 setadd | yes | 64,724 setcount | | 813,008 setismember | | 380,228 setdelete | yes | 61,349 listleftpush | yes | 68,775 listcount | | 666,666 listleftpop | yes | 60,277 listrightpush | yes | 64,641 listcount | | 609,756 listrightpop | yes | 56,433 sortedlistadd | yes | 68,493 sortedlistcount | | 588,235 sortedlistleftpop | yes | 14,880 sortedlistadd | yes | 67,114 sortedlistrightpop | yes | 7,923 sortedsetadd | yes | 47,393 sortedsetismember | | 285,714 sortedsetcount | | 500,000 sortedsetleft | yes | 16,181 sortedsetright | yes | 9,082 sortedsetdelete | yes | 19,920
&[u8]
;rand
to v0.8
, bytes
to v1.0
;sorted set
data type.for_each_key_with_prefix
& keys
& keys_with_prefix
operations.map_for_each_with_prefix
& map_items_with_prefix
operations.```text MIT License
Copyright (c) 2020 Zongmin Lei leizongmin@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```