redis/hiredis logo

redis/hiredis

Free

Minimalistic C client for Redis >= 1.2

FreeFree tier
Type
Open Source
Company
Redis

About redis/hiredis

Hiredis is a minimalistic C client library for the Redis database, designed to provide minimal support for the Redis protocol while offering a high-level printf-alike API for sending commands. It features a decoupled reply parser that is stream-based and designed for easy reusability, making it suitable for integration into higher-level language bindings. The library supports multiple APIs including synchronous, asynchronous, and reply parsing, and is compatible with Redis versions 1.2.0 and later. It uses the binary-safe Redis protocol, ensuring broad compatibility.

Key Features

Minimalistic design with minimal protocol overhead
High-level printf-alike API for sending commands
Decoupled stream-based reply parser for I/O-independent parsing
Synchronous, asynchronous, and reply parsing APIs
Binary-safe protocol support for Redis >= 1.2.0
Designed for easy reuse in higher-level language bindings

Pros & Cons

Pros
  • Lightweight and minimalistic, suitable for constrained environments
  • High-level API simplifies command construction
  • Decoupled reply parser allows flexible I/O integration
  • Supports multiple API models (sync, async, parsing)
  • Open source with a long history and active maintenance
Cons
  • Limited to bare protocol support; lacks advanced client features like connection pooling or automatic reconnection
  • C-only library, not usable directly from other languages without bindings
  • Manual memory management required (C library)

Best For

Building Redis client libraries in higher-level programming languagesInteracting with Redis directly from C applicationsEmbedding Redis command execution and reply parsing in performance-sensitive systems

FAQ

What Redis versions are supported?
Hiredis supports the binary-safe Redis protocol and works with Redis versions 1.2.0 and later.
What APIs does hiredis provide?
Hiredis provides a synchronous API, an asynchronous API, and a reply parsing API.
Is hiredis suitable for use in language bindings?
Yes, hiredis includes a decoupled reply parser that is stream-based and designed for easy reusability in higher-level language bindings.
Does hiredis support SSL/TLS?
Yes, hiredis includes an SSL module (hiredis_ssl) for secure connections.