Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kostya/tkrzw
Fast Persistent Key Value Storage
https://github.com/kostya/tkrzw
Last synced: 20 days ago
JSON representation
Fast Persistent Key Value Storage
- Host: GitHub
- URL: https://github.com/kostya/tkrzw
- Owner: kostya
- License: mit
- Created: 2022-01-16T09:34:48.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-30T22:23:29.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T22:52:37.453Z (over 1 year ago)
- Language: Crystal
- Homepage:
- Size: 16.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tkrzw
Fast Persistent KeyValue Storage. Wrapper for [Tkrzw](https://dbmx.net/tkrzw/)
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
tkrzw:
github: kostya/tkrzw
```## Usage
```crystal
require "tkrzw"db = Tkrzw::DB.new("1.tkh")
db.set("bla", "jo")p db.get("bla")
p db.get("bla2")db.each do |k, v|
p k, v
enddb.close
```
## Compare with [LevelDB](https://github.com/crystal-community/leveldb) and [KyotoCabinet](https://github.com/kostya/kyotocabinet)| test | Tkrzw | LevelDB | KyotoCabinet |
| ------------------------ | ------ | ------- | ------------ |
| 2 mln set | 1.22s | 3.95s | 1.66s |
| 2 mln get | 0.96s | 2.43s | 1.22s |
| iterate over all records | 1.19s | 0.34s | 0.73s |
| db size | 65Mb | 21Mb | 83Mb |
| memory used | 72.2Mb | 97.1Mb | 70.4Mb |