Questions tagged [hiredis]

Hiredis is a minimalistic C client library for the Redis database

Hiredis is a minimalistic C client library for the Redis database.

It is minimalistic because it just adds minimal support for the protocol, but at the same time it uses an high level printf-alike API in order to make it much higher level than otherwise suggested by its minimal code base and the lack of explicit bindings for every Redis command.

Apart from supporting sending commands and receiving replies, it comes with a reply parser that is decoupled from the I/O layer. It is a stream parser designed for easy reusability, which can for instance be used in higher level language bindings for efficient reply parsing.

Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis version >= 1.2.0.

The library comes with multiple APIs. There is the synchronous API, the asynchronous API and the reply parsing API.

Source Code: https://github.com/redis/hiredis

139 questions
1
vote
1 answer

Dump the whole redis database instance using hiredis

I have a buffer that needs to read all values(hash, field and values) from redis after reboot, is there a way to do that in a fast way? I have approximately 100,000 hashes with 4 fields each. Thanks! EDIT: The Slow way: Current Implementation is…
Vikyboss
  • 940
  • 2
  • 11
  • 23
1
vote
2 answers

Redis database storage limit and HA

I want to use redis server for my application which is having a large database. So i want to know how big data redis server can store ??? is it compatible for a large database as i have heard that redis is a in memory database
Vishnu
  • 91
  • 1
  • 2
1
vote
1 answer

Redis multi client server architecture

I am having a application which is using redis. Its a two box system means the application is in HA(High availability architecture). When a box go down i want to recover the all the data on that box to sync with first box and vice versa. Is is…
Vishnu
  • 91
  • 1
  • 2
0
votes
1 answer

Receiving reply in hiredis

I'm trying to check if I'm filling redis database using hiredis correctly. Via redisCommand() I send it HSET first, then HGETALL , expecting to have command callback at reply->str, but reply->str remains…
cucurbita
  • 31
  • 4
0
votes
0 answers

Hiredis cluster with Redis Stack modules

I’m using hiredis cluster in order to use cluster feature with Redis. In latest hiredis cluster, there is one python script to generate command file. To do this, we need to give Redis path as an argument to the script. There is no problem till here.…
0
votes
0 answers

(error) ERR unknown command 'touch' on Redis for Windows

I have currently installed Redis for Windows, when I run Redis-cli all the simple commands (set, get, hset, hget etc.) work. However the command 'touch' doesn't work and I get the error in the title. I am also trying to build Redis-plus-plus on…
beepboop
  • 1
  • 3
0
votes
0 answers

Adding a string value as member in redis sorted set using C application

In my C application as shown below I am trying to add a string as the member in a redis sorted set. Looks like it is not working as expected #include #include #include #include int main() { …
codingfreak
  • 4,467
  • 11
  • 48
  • 60
0
votes
1 answer

Clang linking error when using library redis++

I am using Windos 10, Clang 11.0 installed from Visual Studio installer. I want to use library redis++, so I first installed library hiredis (I built it with selecting toolset "cmake -T ClangCL ...") and then installed redis++ with similar cmake…
user3007875
  • 123
  • 7
0
votes
2 answers

[hiredis]Multiple hincrbys only return one result(REDIS_REPLY_INTEGER)

When using hiredis, use redisAppendCommand to put multiple hincrby commands, the reply->type result of redisGetReply is REDIS_REPLY_INTEGER, and only one of the results is returned. But when I use hmget, the result of reply->type is…
Stream_
  • 13
  • 3
0
votes
1 answer

C: hiredis discard buffer more than 1k

I'm using hiredis and got some strange error. After reviewing the source code, I found that hiredis discards part of the buffer when its size exceeds 1024. I'm not sure if it's safe to remove this constraint or if there is any way to bypass this…
Seraph
  • 177
  • 12
0
votes
1 answer

How to get just the value from JSON.GET using RedisJSON, without the surrounding brackets and double quotes?

Using Redis v6 and RedisJSON v2.2.0. Sample json: [ { "msg": "hello", "sql": "blah" } ] I can successfully get the msg value by calling: redisReply *reply = redisCommand(context, "JSON.GET sample-rj…
Dan
  • 2,209
  • 3
  • 23
  • 44
0
votes
0 answers

Protocol error while publishing on Redis using hiredis

Problem Description I am using hiredis unix socket to publish a number of messages (~2 KB per second) on a RPI 4B. I use the code given below to publish. I start getting Redis Protocol error messages after approximately 30-45 minutes of operation.…
tagsense
  • 81
  • 2
  • 8
0
votes
0 answers

RedisCluster::set is causing seg fault

Getting seg fault as debugged using Gdb for the following snippet: ConnectionOptions connection_options; connection_options.host = "127.0.0.1"; // Required. connection_options.port = 9001; // Optional. The default port is…
0
votes
1 answer

Sending data to Redis in JSON format using hiredis

I am completely new to Redis. I have a C application running on an Embedded Linux device which should connect to a Redis exposed locally. I am using Hiredis. I can successfully connect to the Redis using redisConnect(). Now I need to write…
Engineer999
  • 3,683
  • 6
  • 33
  • 71
0
votes
1 answer

NOT Checking Replies after Pipelining w/HIREDIS

Is there any harm in simply not calling redisGetReply() after calling redisAppendCommand() one or more times? If I don't need the reply or need to check error conditions I was hoping to avoid the performance penalty. Or do I need to check and free…