Git Product home page Git Product logo

redis-cplusplus-client's Introduction

A C++ client for Redis

  • Depends on c++ boost library
  • It uses anet from Redis itself
  • It has been tested with g++ on Linux (and older versions also on Mac OS X 10.5)
  • Sharding (consistent hashing with support for user-specified algorithm)

Notes on consistent hashing / sharding

The redis-cplusplus-client supports (or will soon support) nearly all commands in multi-server mode. As the sharding is based on the key name by consistent hashing, multi key commands must call more then one server and do some local aggregation. This means that you loose the atomicity which is normally guaranteed by redis. When using read-only commands like MGET this might only be a small problem in your use-cases. But this can lead to hard to trace race-conditions when using writing commands like MSETNX, where the command must be undone on the first servers when it fails on a later server. Other commands like BLPOP will likely never work when the keys are not on the same server.

Please note, that in some use-cases you can get all the atomicity guaranteed by a single redis server, when you use key prefixes and an own hashing algorithm, so that you can map all keys that might be used together in the same multi key command to a single redis server. (If you have two types of lists, "X" and "Y", it is unlikely, that you use this types mixed together in a single BLPOP so you can put "X:" on redis server 1 and "Y:" on redis server 2)

Status

This client is based on the initial release of a redis c++ client from http://github.com/fictorial/redis-cplusplus-client. It was changed to work with Redis 1.2 and 2.0. Please note, that this software has an experimental state.

API: It is not guaranteed that the api from the initial 'fictorial' release will be continued. Generally the current api is not stable and not well documented. Please have a look at the provided test cases (test_client.cpp) to see what is currently possible.

Any kind of feedback, suggestions and bug reports is very welcome.

License

This client is licensed under the same license as redis.

Authors

  • Brian Hammond (intial 'fictorial' release)
  • Ludger Sprenker ('mrpi' release: extensions and changes for redis versions greater 1.1)

redis-cplusplus-client's People

Contributors

mrpi avatar fictorial avatar tcshadowwalker avatar

Watchers

James Cloos avatar  avatar

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.