redis-tsv
Version, currently 0.2.02 versions
- 0.2.1latestJun 15, 2016
- 0.2.0not indexedJan 6, 2017
github.com/maiha/redis-tsv.cr
import and export data from Redis in TSV format
Nothing has been indexed for 0.2.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:
redis-tsv:
github: maiha/redis-tsv.cr
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.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.
redis-tsv 
import and export data from Redis in TSV format
% redis-tsv export > backup.tsv
% redis-tsv import backup.tsv
% redis-tsv keys > keys.list
- Crystal: 0.18.0
- Binary: https://github.com/maiha/redis-tsv.cr/releases
Benchmark
- Bench: import, export and keys with count option (default: 1000)
| | COUNT | Time | QPS | Unix Command | |:-----|-------:|---------:|-------:|:-------------------------------------| |import| 1000 | 21.9 sec | 457567 | redis-tsv import -c 1000 10M.tsv | | | 10000 | 19.6 sec | 509422 | redis-tsv import -c 10000 10M.tsv | | | 100000 | 16.2 sec | 617951 | redis-tsv import -c 100000 10M.tsv | |export| 1000 |465.1 sec | 21500 | redis-tsv export -c 1000 > 10M.tsv | | | 10000 | 90.9 sec | 110002 | redis-tsv export -c 10000 > 10M.tsv | | | 100000 | 17.2 sec | 582429 | redis-tsv export -c 100000 > 10M.tsv | |keys | 1000 | 10.9 sec | 915983 | redis-tsv keys -c 1000 > keys.list | | | 10000 | 8.9 sec | 1124260| redis-tsv keys -c 10000 > keys.list | | | 100000 | 7.6 sec | 1311586| redis-tsv keys -c 100000 > keys.list |
- CPU: Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
- TSV:
10M.tsv(10M entries where key = val = "%08d")
00000001 00000001
00000002 00000002
...
10000000 10000000
TODO
- [x]
keysshould useSCANrather thanKEYS * - [x]
importshould set data by degrees not at once - [x]
exportshould useSCANrather thanKEYS * - [x] add spec about bulk operations
Installation
- needs Crystal to compile
crystal deps # for the first time only
make
cp bin/redis-tsv ~/bin/
Usage
Bulk operations
- import
redis-tsv import foo.tsv
redis-tsv -d, import foo.csv
- export
redis-tsv export > foo.tsv
redis-tsv -d, export > foo.csv
- keys
redis-tsv keys > keys.list
options
-cgrows performance, but uses much memory and locks server.
redis-tsv export -c 1000 > foo.tsv # 1m13s (default)
redis-tsv export -c 10000 > foo.tsv # 7m28s (6 times faster)
(entry count: 10M)
information
util commands for easy access to INFO
count: show a number of keys
% redis-tsv count
10000000
version: show the redis version
% redis-tsv version
3.0.6
role: show the role of replication
% redis-tsv role
master
ping: execute PING command
% redis-tsv ping
PONG
info(INFO result itself)
% redis-tsv info
# Server
redis_version:3.0.6
redis_git_sha1:00000000
...
Test
- CAUTION: This spec flushes your redis db on
localhost:6379.
% crystal spec
Contributing
- Fork it ( https://github.com/maiha/redis-tsv.cr/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
- [maiha] maiha - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jan 6, 2017
- Commit
8011ed6f86a7- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/maiha/redis-tsv.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 2