Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C
  3. Hiredis

Hiredis

BSD-3-ClauseCv1.4.0

A minimalistic C client library for Redis, featuring synchronous, asynchronous, and reply parsing APIs.

GitHubGitHub
6.7k stars1.8k forks0 contributors

What is Hiredis?

Hiredis is a minimalistic C client library for Redis, designed to facilitate communication with Redis servers through a simple yet powerful API. It solves the problem of integrating Redis into C applications by providing synchronous, asynchronous, and reply parsing interfaces, all while maintaining a small code footprint and high performance.

Target Audience

C developers building applications that require efficient Redis database interactions, including embedded systems, high-performance servers, and language bindings for other programming languages.

Value Proposition

Developers choose Hiredis for its balance of minimalism and functionality, offering a straightforward API that reduces complexity without sacrificing features like SSL/TLS support, RESP3 compliance, and asynchronous operation, making it the de facto standard C client for Redis.

Overview

Minimalistic C client for Redis >= 1.2

Use Cases

Best For

  • Building high-performance Redis clients in C
  • Creating language bindings for Redis in other programming languages
  • Embedded systems requiring lightweight Redis connectivity
  • Asynchronous Redis interactions in event-driven applications
  • Implementing custom Redis protocol parsers
  • Applications needing SSL/TLS-secured Redis connections

Not Ideal For

  • Projects using languages other than C that need Redis integration without low-level coding
  • Applications requiring built-in connection pooling, automatic failover, or Redis Cluster management
  • Teams seeking high-level abstractions or ORM-like features for rapid application development
  • Environments where avoiding breaking changes and maintaining long-term API stability is critical

Pros & Cons

Pros

Minimal Code Footprint

Hiredis is designed to be lightweight with a small codebase, minimizing overhead and making it ideal for embedded systems or performance-critical applications, as highlighted in its minimalist philosophy.

Flexible API Options

Offers synchronous, asynchronous, and reply parsing APIs, allowing developers to choose between blocking calls, event-driven designs with libev/libevent, and custom parsing for language bindings.

Full RESP3 Support

Completely compatible with Redis Serialization Protocol version 3, including new data types like maps, sets, and push notifications, ensuring future-proofing for modern Redis features.

SSL/TLS Integration

Supports secure connections via optional OpenSSL binding, though it requires explicit build flags and linking against separate libraries, as detailed in the SSL/TLS section.

Custom Allocator Injection

Allows injection of custom memory allocation functions through hiredisAllocFuncs, enabling integration with specialized memory management systems without modifying core library code.

Cons

Breaking Changes Across Versions

Upgrading between major versions, such as from 0.14.1 to 1.0.0, involves API breaks like renamed fields and added members, requiring code updates and recompilation, as warned in multiple 'IMPORTANT' sections.

Lacks High-Level Convenience Features

Does not include built-in connection pooling, automatic reconnection, or command retries, forcing developers to implement these manually, which increases boilerplate code for production use.

Complex Setup for Advanced Features

Enabling SSL/TLS requires building with USE_SSL=1, linking against OpenSSL, and managing separate contexts, adding steps and dependencies that complicate deployment compared to all-in-one clients.

No Thread Safety Guarantees

The README explicitly states that redisContext and redisAsyncContext are not thread-safe, necessitating external synchronization in multi-threaded applications, which can lead to bugs if overlooked.

Frequently Asked Questions

Quick Stats

Stars6,675
Forks1,847
Contributors0
Open Issues47
Last commit1 month ago
CreatedSince 2010

Tags

#database-driver#c-library#embedded-systems#pipelining#ssl-tls#redis-client#asynchronous-io#resp3#network-protocol

Built With

O
OpenSSL
C
C++

Included in

C/C++70.6kC3.8k
Auto-fetched 19 hours ago

Related Projects

LevelDBLevelDB

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.

Stars39,251
Forks8,204
Last commit4 months ago
RocksDBRocksDB

A library that provides an embeddable, persistent key-value store for fast storage.

Stars31,903
Forks6,880
Last commit19 hours ago
InfinityInfinity

The AI-native database built for LLM applications, providing incredibly fast hybrid search of dense vector, sparse vector, tensor (multi-vector), and full-text.

Stars4,629
Forks431
Last commit1 day ago
KvrocksKvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.

Stars4,378
Forks642
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub