github.com/kostya/tkrzw

Fast Persistent Key Value Storage

9 stars
0 dependents
License: MIT

Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  tkrzw:
    github: kostya/tkrzw
    version: ~> 0.1.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.1.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

# 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
end

db.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       |