Redis client for Go
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
internal/bytesutil Add comments to functions in bytesutil package Dec 29, 2018
resp Move tests from resp2 to bytesutil package Dec 29, 2018
.gitignore add .travis.yml and Makefile Dec 18, 2015
.travis.yml update travis file to work with go 1.10 and not block forever after s… Dec 29, 2018
CONTRIBUTING.md remove CHANGELOG and Makefile, update travis (sorta), update CONTRIBU… Jul 8, 2017
LICENSE.txt FORK update readme and other files in project root Feb 2, 2015
README.md README: update with latest benchmarks Jan 8, 2019
action.go rename package to radix/v3, and use go modules Nov 14, 2018
action_test.go Remove test for stream support in action_test.go Dec 29, 2018
bench_test.go Rename multiple pipelines benchmark Jan 6, 2019
cluster.go rename package to radix/v3, and use go modules Nov 14, 2018
cluster_crc16.go fix cluster slots algo slightly, thanks to @nickynick for the fix Aug 26, 2017
cluster_crc16_test.go fix cluster slots algo slightly, thanks to @nickynick for the fix Aug 26, 2017
cluster_scanner.go cluster: remove WithPrimaries method, add Client method (like sentine… Oct 27, 2018
cluster_scanner_test.go Close Cluster instances in tests Dec 30, 2018
cluster_stub_test.go rename package to radix/v3, and use go modules Nov 14, 2018
cluster_test.go Close Cluster instances in tests Dec 30, 2018
cluster_topo.go rename package to radix/v3, and use go modules Nov 14, 2018
cluster_topo_test.go rename package to radix/v3, and use go modules Nov 14, 2018
go.mod Add redispipe to benchmarks Jan 1, 2019
go.sum Add redispipe to benchmarks Jan 1, 2019
pipeliner.go Fix spelling Jan 7, 2019
pool.go Fix PoolPipelineLimit in comment Jan 7, 2019
pool_test.go pool: clean up unused fields, misnamed variables, and rename staticPo… Dec 23, 2018
pubsub.go fix pubsub ping interval to match other application level timeout val… Jan 6, 2019
pubsub_persistent.go Refactor Dial, remove the DialTimeout dialer function Oct 8, 2018
pubsub_persistent_test.go make PersistantPubSub take in a ConnFunc Jul 2, 2017
pubsub_stub.go rename package to radix/v3, and use go modules Nov 14, 2018
pubsub_stub_test.go rename package to radix/v3, and use go modules Nov 14, 2018
pubsub_test.go make default Conn not close on a net.Error, let Pool handle that kind… Jan 3, 2019
radix.go normalize default timeout values across the project Jan 5, 2019
radix_test.go pubsub: add test to ensure timeout logic is working exactly as intended Dec 23, 2018
scanner.go finish reading through documentation Jul 8, 2017
scanner_test.go finish reading through documentation Jul 8, 2017
sentinel.go normalize default timeout values across the project Jan 5, 2019
sentinel_test.go sentinel: tests for client retrieval and carry-over-upon-failover Jan 3, 2019
stream.go Revert "Ignore temporary timeouts" Dec 29, 2018
stream_test.go Merge branch 'master' into pipelined-poc Jan 5, 2019
stub.go make Stub support Pipeline properly (fixes #49) Nov 25, 2018
stub_test.go make Stub support Pipeline properly (fixes #49) Nov 25, 2018
timer.go ran gofmt Oct 27, 2018

README.md

Radix

Build Status Go Report Card GoDoc

Radix is a full-featured Redis client for Go. See the GoDoc for documentation and general usage examples.

This is the third revision of this project, the previous one has been deprecated but can be found here.

This project's name was recently changed from radix.v3 to radix, to account for go's new module system. As long as you are using the latest update of your major go version (1.9.7+, 1.10.3+, 1.11+) the module-aware go get should work correctly with the new import path.

I'm sorry to anyone for whom this change broke their build, I tried very hard to not have to do it, but ultimately it was the only way that made sense for the future. Hopefully the only thing needed to fix the breakage is to change the import paths and re-run 'go get'.

Installation and Usage

Module-aware mode:

go get github.com/mediocregopher/radix/v3
// import github.com/mediocregopher/radix/v3

Legacy GOPATH mode:

go get github.com/mediocregopher/radix
// import github.com/mediocregopher/radix

Testing

# requires a redis server running on 127.0.0.1:6379
go test github.com/mediocregopher/radix/v3

Features

  • Standard print-like API which supports all current and future redis commands

  • Support for using an io.Reader as a command argument and writing responses to an io.Writer.

  • Connection pooling

  • Helpers for EVAL, SCAN, and pipelining

  • Support for pubsub, as well as persistent pubsub wherein if a connection is lost a new one transparently replaces it.

  • Full support for sentinel and cluster

  • Nearly all important types are interfaces, allowing for custom implementations of nearly anything.

Benchmarks

Thanks to a huge amount of work put in by @nussjustin, and inspiration from the redispipe project and @funny-falcon, radix/v3 is significantly faster than most redis drivers, including redigo, for normal parallel workloads, and is pretty comparable for serial workloads.

# go test -v -run=XXX -bench=GetSet -benchmem >/tmp/radix.stat
# benchstat radix.stat
name                                     time/op
SerialGetSet/radix                         89.1µs ± 7%
SerialGetSet/redigo                        87.3µs ± 7%
ParallelGetSet/radix/default-8             5.47µs ± 2%  <--- The good stuff
ParallelGetSet/redigo-8                    27.6µs ± 2%
ParallelGetSet/redispipe-8                 4.16µs ± 3%

name                                      alloc/op
SerialGetSet/radix                          67.0B ± 0%
SerialGetSet/redigo                         86.0B ± 0%
ParallelGetSet/radix/default-8              73.0B ± 0%
ParallelGetSet/redigo-8                      138B ± 4%
ParallelGetSet/redispipe-8                   168B ± 0%

name                                       allocs/op
SerialGetSet/radix                           4.00 ± 0%
SerialGetSet/redigo                          5.00 ± 0%
ParallelGetSet/radix/default-8               4.00 ± 0%
ParallelGetSet/redigo-8                      6.00 ± 0%
ParallelGetSet/redispipe-8                   8.00 ± 0%

Copyright and licensing

Unless otherwise noted, the source files are distributed under the MIT License found in the LICENSE.txt file.