HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
antirez
redis
C2009–2020
antirez / redis

redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.

142Distinct people
165Mentions
3Explicit recommenders
169GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.

GitHub

Where it is used

  • Sidekiq — Sidekiq uses Redis as the storage engine for all job and operational data. It connects to Redis by default and provides guidance for production configuration. Source

What people are saying

Ah I see. I didn't realize it was old, I just picked server.c since it just sounded like it'd have a decent mix of stuff. I think the only 'taste' things I mentioned is the…

mehrdadn used a recommendation phrase. 3 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year165 dated mentions

Observed mentions: 2009-09-03 00:45:38 UTC to 2020-06-30 21:42:49 UTC.

01020302009-01-01 00:00:00 UTC to 2010-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20092010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 12 mentions; 3 submissions, 9 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 18 mentions; 5 submissions, 13 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 12 mentions; 0 submissions, 12 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 17 mentions; 3 submissions, 14 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 26 mentions; 5 submissions, 21 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 16 mentions; 2 submissions, 14 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 27 mentions; 8 submissions, 19 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 16 mentions; 3 submissions, 13 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2020

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20092009-01-01 00:00:00 UTC2010-01-01 00:00:00 UTC211
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC615
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC1239
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC18513
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC12012
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC725
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC17314
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC26521
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC16214
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC27819
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC16313
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC606

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
This document serves as both a quick start guide to Redis and a detailed resource for building it from source. New to Redis? Start with What is Redis and Getting Started Ready to build from source? Jump to Build Redis from Source Want to contribute? See the Code contributions section and CONTRIBUTING.md Looking for detailed documentation? Navigate to redis.io/docs Table of contents What is Redis? Key use cases Why choose Redis? What is Redis Open Source? Getting started Redis starter projects Using Redis with client libraries Using Redis with redis-cli Using Redis with Redis Insight Redis data types, processing engines, and capabilities Community Build Redis from source Build and run Redis with all data structures - Ubuntu 20.04 (Focal) Build and run Redis with all data structures - Ubuntu 22.04 (Jammy) / 24.04 (Noble) Build and run Redis with all data structures - Debian 11 (Bullseye) / 12 (Bookworm) Build and run Redis with all data structures - AlmaLinux 8.10 / Rocky Linux 8.10 Build and run Redis with all data structures - AlmaLinux 9.5 / Rocky Linux 9.5 Build and run Redis with all data structures - macOS 13 (Ventura) and macOS 14 (Sonoma) Build and run Redis with all data structures - macOS 15 (Sequoia) Building Redis - flags and general notes Fixing build problems with dependencies or cached build options Fixing problems building 32 bit binaries Allocator Monotonic clock Verbose build Running Redis with TLS Code contributions Redis Trademarks What is Redis? For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine. Key use cases Redis excels in various applications, including: Caching: Supports multiple eviction policies, key expiration, and hash-field expiration. Distributed Session Store: Offers flexible session data modeling (string, JSON, hash). Data Structure Server: Provides low-level data structures (strings, lists, sets, hashes, sorted sets, JSON, etc.) with high-level semantics (counters, queues, leaderboards, rate limiters) and supports transactions & scripting. NoSQL Data Store: Key-value, document, and time series data storage. Search and Query Engine: Indexing for hash/JSON documents, supporting vector search, full-text search, geospatial queries, ranking, and aggregations via Redis Query Engine. Event Store & Message Broker: Implements queues (lists), priority queues (sorted sets), event deduplication (sets), streams, and pub/sub with probabilistic stream processing capabilities. Vector Store for GenAI: Integrates with AI applications (e.g. LangGraph, mem0) for short-term memory, long-term memory, LLM response caching (semantic caching), and retrieval augmented generation (RAG). Real-Time Analytics: Powers personalization, recommendations, fraud detection, and risk assessment. Why choose Redis? Redis is a popular choice for developers worldwide due to its combination of speed, flexibility, and rich feature set. Here's why people choose Redis for: Performance: Because Redis keeps data primarily in memory and uses efficient data structures, it achieves extremely low latency (often sub-millisecond) for both read and write operations. This makes it ideal for applications demanding real-time responsiveness. Flexibility: Redis isn't just a key-value store, it provides native support for a wide range of data structures and capabilities listed in What is Redis? Extensibility: Redis is not limited to the built-in data structures, it has a modules API that makes it possible to extend Redis functionality and rapidly implement new Redis commands Simplicity: Redis has a simple, text-based protocol and well-documented command set Ubiquity: Redis is battle tested in production workloads at a massive scale. There is a good chance you indirectly interact with Redis several times daily Versatility: Redis is the de facto standard for use cases such as: Caching: quickly access frequently used data without needing to query your primary database Session management: read and write user session data without hurting user experience or slowing down every API call Querying, sorting, and analytics: perform deduplication, full text search, and secondary indexing on in-memory data as fast as possible Messaging and interservice communication: job queues, message brokering, pub/sub, and streams for communicating between services Vector operations: Long-term and short-term LLM memory, RAG content retrieval, semantic caching, semantic routing, and vector similarity search In summary, Redis provides a powerful, fast, and flexible toolkit for solving a wide variety of data management challenges. If you want to know more, here is a list of starting points: Introduction to Redis data types The full list of Redis commands Redis for AI Redis documentation What is Redis Open Source? Redis Community Edition (Redis CE) was renamed Redis Open Source with the v8.0 release. Redis Ltd. also offers Redis Software, a self-managed software with additional compliance, reliability, and resiliency for enterprise scaling, and Redis Cloud, a fully managed service integrated with Google Cloud, Azure, and AWS for production-ready apps. Read more about the differences between Redis Open Source and Redis here. Getting started If you want to get up and running with Redis quickly without needing to build from source, use one of the following methods: Redis Cloud Official Redis Docker images (Alpine/Debian) docker run -d -p 6379:6379 redis:latest Redis binary distributions Snap Homebrew RPM Debian Redis quick start guides If you prefer to build Redis from source - see instructions below. Redis starter projects To get started as quickly as possible in your language of choice, use one of the following starter projects: Python (redis-py) C#/.NET (NRedisStack/StackExchange.Redis) Go (go-redis) JavaScript (node-redis) Java/Spring (Jedis) Using Redis with client libraries T
Read the full README on GitHub

What Hacker News says

165 sources
Thanks for everything you have given the community. And I look forward to more blog posts, they are always fun to read. I also want to thank you for making this decision while you were still active, Redis didn't skip a beat. Right up to announcing this you made sure that the community made progress. As we at GitLab detail in https://about.gitlab.com/blog/2020/06/24/scaling-our-use-of-... in April you personally responded to an issue https://github.com/antirez/redis/issues/7071 within an hour. I glad you are choosing for what makes you happy, you more than earned it.
In The End of the Redis Adventure
> monstrous, complicated, stateful streams feature It's two data structures (which were already in Redis for other reasons!), and an automatic sequential identifier. Everything else that's "stateful" about it is client-side state—the server is still just a data-structure server. A Redis stream is basically just a Redis sorted set that's coherent in the face of clients trying to consume it paginated as other clients insert into the middle of it. Also, the code is in one file (https://github.com/antirez/redis/blob/unstable/src/t_stream.... ); that file is ~3KLOC. It's just another Redis Module, isolated into its own set of functions with no impact on the codebase as a whole. It's just one that's so widely applicable, to so many use-cases that people were already using Redis for (through Sidekiq/Resque/etc) that it makes sense to ship this p
Read the rest
articular module with Redis itself. Would you get upset about bloat if Postgres upstreamed a highly-popular extension? It already has nine or ten installed by default, and a few more sitting in contrib/. But, of course, even upstreamed, none of those extensions are enabled by default, adding runtime overhead to your DB; you have to ask for them, just as if you were installing a third-party extension. Same here: if you don't use the Streams module, there's no overhead to its existence in the Redis codebase. > do people really expose Redis on the internet?? Cloud DBaaS providers expose Redis instances "over the Internet", in the sense that they're in the same AZ but not within your VPC. To the extent that you can wireshark a data-center's virtual SDN, they need to encrypt this traffic. Even PaaS providers do things this way, since they usually lean on third-party DBaaS providers. E.g. all of the Redis services you can attach to a Heroku app are consumed "over the Internet." If you're using Redis through an IaaS provider's offering (e.g. AWS ElastiCache, Google Cloud Memorystore) then you get the benefit of them being able to spawn an instance "outside" your project/VPC (i.e. having it be managed by them), but have it nevertheless routed to an IP address inside your VPC. That might be enough security for you, if you don't have any legal requirements saying otherwise. For some people, it's not, and they need TLS on top anyway. > cluster stuff Have you looked at how it's done? It's just ease-of-use tooling around the obvious thing to do to scale Redis: partitioning the keyspace onto distinct Redis instances, and then routing requests to partitions based on the key. It's not like Redis has suddenly become a multi-master consensus system like Zookeeper; the router logic isn't even in the server codebase!
In Redis 6.0 GA
Something smelled fishy, so I did a bit of follow-up. This dude is leaving out a huge detail to make his employment troubles be a pivotal problem when...it's not. Let's footnote a coupleo f his "Story of Pivotal The Employment" > Hired To contribute to Redis > All My Work Is Owned by Another Employee? What? The primary redis maintainer, not a pivotal employee? > Let’s Organize Instead of Being A Hobby Project Let's misrepresent the philosophical position of the OS project maintainer on the best way to move the project forward. > Two Days of Work to Clear 4 Years of Issues Ignored By The Creator Because Laziness A bunc hof those issues have fundamental problems that the creator explicitly drilled into and explained (https://github.com/antirez/redis/pull/1906#issuecomment-5145...)
In How I survived being a $220k/year intern
That was my thinking as well, though taking a peek at the actual code suggests that there's a pretty deep expectation that the client is speaking strings, e.g. in code that handles the ZRANGE command[1] I see if (c->argc == 5 && !strcasecmp(c->argv[4]->ptr,"withscores")) and a quick grep suggests that's a common pattern % grep argv src/*.c | grep -c -e 'str\(case\)*cmp' 482 I guess this means someone would have to tackle creating an intermediate binary format first, rewriting the command handlers to expect that format, and then making client libraries that can produce the format. Perhaps still worth it in the end, but not trivial. [1] https://github.com/antirez/redis/blob/unstable/src/t_zset.c#...
In A multithreaded fork of Redis that is faster
mehrdadn·Aug 1, 2019Recommendation phrase
Ah I see. I didn't realize it was old, I just picked server.c since it just sounded like it'd have a decent mix of stuff. I think the only 'taste' things I mentioned is the lack of braces and possibly the function name, which I'm happy to ignore. But the rest were just inconsistencies, regardless of which way anyone's tastes lean -- the spaces after commas are entirely inconsistent (although I would argue if you took the stance that there shouldn't be a space at all, that's bordering on just being wrong, not merely a matter of taste!), and some lines are far longer than 80 columns [1] and some are broken at really inconvenient points just to fit them into 80 columns, which gets you the worst of both worlds. Thankfully, like you said, the other files do seem better. :) However, they do have the same problems I just pointed out above: space
Read the rest
s are inconsistent everywhere (after commas, after 'while', after casts, etc.) and lacking in awful places (honestly, how am I supposed to read a function call with eight identifiers and zero spaces? [2]) and some lines are broken and others longer than 80 [3][4]. A couple other immediate issues I have on syntactic things (semantic analysis would take me a long time so it's hard to give me feedback on that): - One comment I have that some others would vehemently disagree with me on is: I would cut down on the early returns. Personally, I really hate them, for multiple reasons -- the most practical one of which is that they prevent you from inserting a single breakpoint in a debugger (or printf(), or whatever you feel like doing) and being able to see what the function returns easily. Instead, you have to hunt through the entire function and place a dozen breakpoints to make sure you didn't miss any return path. And it becomes the most confusing thing in the world when you inevitably miss one. To me that's bad enough, but some people still insist on them. But if you're going to do that, I would at least make it easier for people to debug them. On my first reading, for example, I completely missed the return on line [5] -- because it's right after the if condition and visually blends in. That also makes it hard if not impossible to put a breakpoint on it, which wouldn't be an issue if it were on a separate line. (Maybe you don't do that because you don't want to forget braces, but you know my opinion on that too. :P) That makes it even more painful to debug this function. - I'm not a fan of the liberal macro usage. I'm not saying you should never use macros -- I know that sometimes it's outright impossible not to (especially in C), and sometimes they're the perfect tool (code deduplication) -- but you shouldn't be using them to use them to define constants and perform normal function calls. [6] [7] Not only is it often possible to break them because of their textual nature, and not only do they lack type information that would be extremely useful, but they also make it harder to debug, since you can't just type them into a debugger at runtime and get their values. And you can't step through them like normal code either. Hope some of this is helpful. All of it said though, they're pretty minor things overall, and the code does seem good quality, at least as far as I can tell in in this timespan. The fact that it's in C does always leave me with this nagging feeling that there's always going to be some resource leak somewhere (especially with early returns!), which I wouldn't have in most other languages, but that's not really an indictment of the code but of the language. And I love, love, love the comments. I don't leave comments nearly that good myself, and I will almost certainly refer back to them later. [1] https://github.com/antirez/redis/blob/583933e2d6b4c2721554ab... [2] https://github.com/antirez/redis/blob/unstable/src/rax.c#L10... [3] https://github.com/antirez/redis/blob/unstable/src/rax.c#L50... [4] https://github.com/antirez/redis/blob/unstable/src/rax.c#L45... [5] https://github.com/antirez/redis/blob/unstable/src/rax.c#L13... [6] https://github.com/antirez/redis/blob/unstable/src/hyperlogl... [7] https://github.com/antirez/redis/blob/unstable/src/quicklist...
In Ask HN: What are the “best” codebases that you've encountered?
I just opened up server.c in Redis (not familiar with Redis and never seen it before) and at first glance it seems... alright, but I'm not sure what's particularly outstanding about it, and it could definitely be better. Some of the logic seems questionable (exit() in a signal handler? [9] also what about thread safety?), and more superficially (but annoyingly) I see: names like "sdscatprintf" [1] which are a little cryptic, lack of attention to spacing (too little [2] or too much [3] or inconsistent [4] [8]), lack of braces for single-line blocks (which at least I consider bad) [5], irritatingly inconsistent line breaks [6], etc. Overall it's still definitely on the more readable side compared to other C code I've seen, I like the thorough comments, and it's generally decent, but I'm not particularly coming away from it in awe like every
Read the rest
In Ask HN: What are the “best” codebases that you've encountered?

Showing the 15 most recent of 165 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.