Skip to content
Redis client for Go
Branch: master
Clone or download
Latest commit 300f7bd Mar 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bench
internal/bytesutil resp2: get rid of all usage of bytesutil.MultiWrite Feb 21, 2019
resp
.gitignore
.travis.yml Update Travis for Go 1.12 Mar 6, 2019
CHANGELOG.md
CONTRIBUTING.md remove CHANGELOG and Makefile, update travis (sorta), update CONTRIBU… Jul 8, 2017
LICENSE.txt
README.md fix link in README Mar 1, 2019
action.go rename package to radix/v3, and use go modules Nov 14, 2018
action_test.go
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
cluster_scanner.go
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
cluster_topo.go rename package to radix/v3, and use go modules Nov 14, 2018
cluster_topo_test.go
go.mod
go.sum clean-up go.mod by moving benchmarks to a sub-module (#68) Feb 15, 2019
pipeliner.go
pool.go cleanup benchmark code a bit (#72) Feb 21, 2019
pool_test.go clean-up go.mod by moving benchmarks to a sub-module (#68) Feb 15, 2019
pubsub.go
pubsub_persistent.go
pubsub_persistent_test.go
pubsub_stub.go
pubsub_stub_test.go
pubsub_test.go
radix.go
radix_test.go pubsub: add test to ensure timeout logic is working exactly as intended Dec 23, 2018
scanner.go Remove unusede field in scanner Mar 6, 2019
scanner_test.go
sentinel.go normalize default timeout values across the project Jan 5, 2019
sentinel_test.go Reformat code Mar 6, 2019
stream.go
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
timer.go

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, as well as marshaling/unmarshaling command arguments from structs.

  • Connection pooling, which takes advantage of implicit pipelining to reduce system calls.

  • Helpers for EVAL, SCAN, and manual 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.

Benchmarks can be run from the bench folder. The following results were obtained by running the benchmarks with -cpu set to 32 and 64, on a 32 core machine, with the redis server on a separate machine. See this thread for more details.

Some of radix's results are not included below because they use a non-default configuration.

# go get rsc.io/benchstat
# cd bench
# go test -v -run=XXX -bench=ParallelGetSet -cpu 32 -cpu 64 -benchmem . >/tmp/radix.stat
# benchstat radix.stat
name                                   time/op
ParallelGetSet/radix/default-32        2.15µs ± 0% <--- The good stuff
ParallelGetSet/radix/default-64        2.05µs ± 0% <--- The better stuff
ParallelGetSet/redigo-32               27.9µs ± 0%
ParallelGetSet/redigo-64               28.5µs ± 0%
ParallelGetSet/redispipe-32            2.02µs ± 0%
ParallelGetSet/redispipe-64            1.71µs ± 0%

name                                   alloc/op
ParallelGetSet/radix/default-32         72.0B ± 0%
ParallelGetSet/radix/default-64         84.0B ± 0%
ParallelGetSet/redigo-32                 119B ± 0%
ParallelGetSet/redigo-64                 120B ± 0%
ParallelGetSet/redispipe-32              168B ± 0%
ParallelGetSet/redispipe-64              172B ± 0%

name                                   allocs/op
ParallelGetSet/radix/default-32          4.00 ± 0%
ParallelGetSet/radix/default-64          4.00 ± 0%
ParallelGetSet/redigo-32                 6.00 ± 0%
ParallelGetSet/redigo-64                 6.00 ± 0%
ParallelGetSet/redispipe-32              8.00 ± 0%
ParallelGetSet/redispipe-64              8.00 ± 0%

Copyright and licensing

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

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.