Git Product home page Git Product logo

radix's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.