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
目录
相关文章
|
1月前
|
NoSQL 网络协议 Linux
Redis的实现一:c、c++的网络通信编程技术,先实现server和client的通信
本文介绍了使用C/C++进行网络通信编程的基础知识,包括创建socket、设置套接字选项、绑定地址、监听连接以及循环接受和处理客户端请求的基本步骤。
48 6
|
1月前
|
存储 监控 NoSQL
Redis的实现二: c、c++的网络通信编程技术,让服务器处理多个client
本文讨论了在C/C++中实现服务器处理多个客户端的技术,重点介绍了事件循环和非阻塞IO的概念,以及如何在Linux上使用epoll来高效地监控和管理多个文件描述符。
28 0
|
6月前
|
XML C++ 数据格式
C++使用gSoap写Web Server和Web Client
C++使用gSoap写Web Server和Web Client
87 1
|
JavaScript 应用服务中间件 Linux
开源项目推荐:C/C++语言版本的http server和client,请关注RESTful
开源项目推荐:C/C++语言版本的http server和client,请关注RESTful
4176 0
|
Java Apache C++
gsoap的c++ server和java client实现
最近项目需要建立向客户方已有系统推送类似于RSS信息的富文本信息,并推送信息待定,由于我们本身项目是C++的,客户系统是java的,又要满足到推送信息可定制可扩展,并必要时可web查看,思量之下采用gsoap轻量级webserver库开发。
1979 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/
3707 0
|
C++ 设计模式 开发框架
基于C++的纯面向对象的通用高性能大并发TCP-SERVER/CLIENT开发框架实践系列之前言篇
  基于C++的纯面向对象的通用高性能大并发TCP-SERVER/CLIENT开发框架实践系列之前言篇 yijian 2008-12-21 technologier@126.com 1. 回首 工作几年了,没什么沉淀,不是忙工作就是忙着休息,大四和工作的第一年还偶尔在一些技术论坛写写文章,但是这都是N年前的事了,以前经常动手编写小程序的习惯也在三四前中断了。
1259 0
|
5天前
|
存储 编译器 C++
【c++】类和对象(下)(取地址运算符重载、深究构造函数、类型转换、static修饰成员、友元、内部类、匿名对象)
本文介绍了C++中类和对象的高级特性,包括取地址运算符重载、构造函数的初始化列表、类型转换、static修饰成员、友元、内部类及匿名对象等内容。文章详细解释了每个概念的使用方法和注意事项,帮助读者深入了解C++面向对象编程的核心机制。
25 5