C++ Client

本文涉及的产品
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Tair(兼容Redis),内存型 2GB
简介:
  • 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)





本文作者:陈群
本文来自云栖社区合作伙伴rediscn,了解相关信息可以关注redis.cn网站。
相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
17天前
|
NoSQL 网络协议 Linux
Redis的实现一:c、c++的网络通信编程技术,先实现server和client的通信
本文介绍了使用C/C++进行网络通信编程的基础知识,包括创建socket、设置套接字选项、绑定地址、监听连接以及循环接受和处理客户端请求的基本步骤。
41 6
|
17天前
|
存储 监控 NoSQL
Redis的实现二: c、c++的网络通信编程技术,让服务器处理多个client
本文讨论了在C/C++中实现服务器处理多个客户端的技术,重点介绍了事件循环和非阻塞IO的概念,以及如何在Linux上使用epoll来高效地监控和管理多个文件描述符。
19 0
|
5月前
|
XML C++ 数据格式
C++使用gSoap写Web Server和Web Client
C++使用gSoap写Web Server和Web Client
79 1
|
JavaScript 应用服务中间件 Linux
开源项目推荐:C/C++语言版本的http server和client,请关注RESTful
开源项目推荐:C/C++语言版本的http server和client,请关注RESTful
4086 0
|
Java Apache C++
gsoap的c++ server和java client实现
最近项目需要建立向客户方已有系统推送类似于RSS信息的富文本信息,并推送信息待定,由于我们本身项目是C++的,客户系统是java的,又要满足到推送信息可定制可扩展,并必要时可web查看,思量之下采用gsoap轻量级webserver库开发。
1975 0
|
NoSQL Redis C++
Redis的C++ client表、Json的C++ client表|汇总|大全
一、 Redis的C++ client表: * From Redis offical site : http://redis.io/clients 序号 名称 网址 最后更新 支持linux 支持windows 支持pub/sub 支持redis版本 备注 1 C++ Client https://github.com/
3701 0
|
C++ 设计模式 开发框架
基于C++的纯面向对象的通用高性能大并发TCP-SERVER/CLIENT开发框架实践系列之前言篇
  基于C++的纯面向对象的通用高性能大并发TCP-SERVER/CLIENT开发框架实践系列之前言篇 yijian 2008-12-21 technologier@126.com 1. 回首 工作几年了,没什么沉淀,不是忙工作就是忙着休息,大四和工作的第一年还偶尔在一些技术论坛写写文章,但是这都是N年前的事了,以前经常动手编写小程序的习惯也在三四前中断了。
1255 0
|
5天前
|
存储 编译器 对象存储
【C++打怪之路Lv5】-- 类和对象(下)
【C++打怪之路Lv5】-- 类和对象(下)
15 4