xRedis API
1.5.0
The C++ Client API for Redis server
|
Redis C++ client, support the data slice storage, support the connection pool
Support multi-node distributed storage of data, can customize the sharding rules;
Support to connect to master and slave nodes of each shard at the same time, support separation of master and slave reads and writes;
Support connection pooling for each storage node;
Support simultaneous connection of multiple data sharding clusters;
Support for connecting to official clusters, single or multiple nodes Support to set up a connection pool to each node,
the client side automatically calculates the slot distribution;
Support automatic calculation of node index position;
Support Redis cluster node change connection automatic switch;
The connection pool to the cluster is automatically updated when the add/delete /slot distribution of the official cluster node changes.
Provide easy to use C++ interface encapsulation, has implemented most of the Redis command;
Only rely on the Hiredis library;
Multi-thread safety
Support password connection;
Support Linux and Windows platforms
https://github.com/0xsky/xredis
xRedis requires hiredis only
First step install libhiredis, on a Debian/Ubuntu system you can use:
on a Redhat/Centos system you can use:
Then checkout the code and compile it
xRedis Architecture diagram
This is an example of how to use the xRedis.
This demo connect to single redis server with connection pool
More details about this example.
See examples directory for more examples
xRedis QQ Group: 190107312