Open-source project
OpenAtomFoundation/pikiwidb avatar
OpenAtomFoundation/pikiwidb

PikiwiDB: a Redis-compatible store that puts your data in RocksDB

Pikiwidb is a Redis-Compatible database developed by Qihoo's infrastructure team.

6,132 stars1,169 forksC++BSD-3-Clause

At a glance

What is it?
PikiwiDB keeps the Redis protocol and data structures but moves storage to RocksDB, so datasets can grow past what RAM allows. Here is how it is built, how to get it running, and where it stops being the right answer.
Who is it for?
Adopt PikiwiDB when your Redis working set has outgrown a single machine's memory and you still want the Redis command surface, the slaveof replication model, and a Codis-style cluster for scaling. Do not adopt it if your workload is small enough to stay in RAM, if you depend on Redis modules, or if you need a release line the project labels stable rather than alpha.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 14 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The memory ceiling PikiwiDB is built to remove

Redis keeps everything in RAM, and the README is direct about what happens as a dataset grows: past roughly 16GiB it lists limited memory capacity, single-threaded blocking, long startup recovery, high memory hardware costs, buffers that fill easily, and expensive failover for one master with several replicas. PikiwiDB targets exactly that point. It is not positioned as a Redis replacement in the README; the stated goal is to complement Redis by keeping the protocol and the operations model while moving the bytes to persistent storage. The intended user is an operator or backend engineer whose dataset has outgrown a memory-bound instance and who does not want to rewrite application code or retrain a team on a different command set. The README also claims deployments at 360 with more than 10,000 instances at 1.8TB each, and lists Weibo among other users. Those are vendor-stated figures, not independently verified here, and they say more about the scale the design targets than about any benchmark you would reproduce.

RocksDB underneath, Redis on the wire

The architecture has three layers worth separating. On the wire, PikiwiDB speaks the Redis protocol and supports the usual structures: string, hash, list, zset, set, geo, hyperloglog, pubsub, bitmap, stream, and ACL. Below that sits a multi-threaded model rather than Redis's single-threaded command loop, which is the structural reason a slow command does not stall every other connection the way it can in Redis. At the bottom is RocksDB as the storage engine, with a multiple-granularity caching model in front of it. The README describes this as hierarchical storage of cold and hot data: hot data is cached, the full dataset lives in RocksDB. One detail matters for capacity planning. In master-slave mode, each data structure gets a separate RocksDB instance. That is a different layout from a single shared keyspace, and it is the kind of decision that shapes how you size disks and how much write amplification you see per structure. The README states the design but does not publish tuning guidance for it.

Two deployment shapes: slaveof and Codis

PikiwiDB ships two deployment models. The first is a single-machine master-slave setup that the README describes as architecturally similar to Redis, using the slaveof command and binlog asynchronous replication, with both full and incremental synchronization supported. That is the low-friction path: if your team already runs Redis replication, the operational vocabulary carries over. The second is a distributed cluster built on the Codis architecture, where multiple groups each form a master-slave set and scaling happens by adding or removing groups. The repository carries a codis/ directory, so the integration is part of the tree rather than an external project you assemble yourself. The trade-off is honest: slaveof mode gives you Redis-like familiarity but keeps you tied to one machine's storage for the primary; Codis mode gives you horizontal scaling at the cost of running a proxy layer and more moving parts. Pick the one that matches your failure budget, not the one that sounds bigger.

Building PikiwiDB and opening a first connection

The repository ships a build.sh at the top level and a CMakeLists.txt, and the README lists CentOS, Ubuntu, macOS, and Rocky Linux as supported platforms. The build script is the entry point the project provides.

bash
./build.sh

Expect a C++ build that pulls in RocksDB and the rest of the dependency set; the README does not enumerate every dependency, so treat a first build as a discovery step on your platform. The repository also has a conf/ directory holding configuration, a docker/ directory, and entrypoint.sh at the root, which is what the Docker path uses.

bash
docker build -t pikiwidb ./docker

The configuration file is where you set the port and the data directory before starting the server. The README does not spell out every key, so read conf/ in the tree for the actual names rather than guessing. To confirm the server is up and speaking Redis, point any Redis client at the port you configured and issue the standard handshake command. A working instance answers the same way Redis does. From there, ordinary commands such as SET and GET behave as they would against Redis, which is the whole point of the compatibility claim. If you are migrating an existing dataset, the tools/ directory holds the migration utilities the README references for a smooth move from Redis without code changes.

Where PikiwiDB is the wrong tool

The most concrete limitation is in the release list. The newest tag is v4.0.4-alpha, and the default branch is unstable. The project does publish non-alpha releases, v3.5.7 and v4.0.3 among them, but the README does not describe a stability policy, a deprecation window, or a rollback procedure for a failed upgrade. If your organization requires a documented support lifecycle before a database goes into production, the repository as it stands does not give you one, and that is a reason to wait or to run it behind a boundary you control. The second limitation is scope. PikiwiDB implements Redis interfaces, not the Redis module system, so anything you built on modules has no home here. The README points to a supported-interface page rather than claiming complete coverage, and that page is the one to read before you assume a command exists. Third, the capacity story cuts both ways: if your dataset fits comfortably in RAM, RocksDB adds disk I/O and compaction work you did not have before, and Redis will simply be faster for the same money. PikiwiDB is a response to a memory ceiling, and if you are not hitting one, you are paying the cost without the benefit.

How it differs from Kvrocks, Pika, and Redis itself

The closest comparison is Kvrocks, which also puts a Redis-compatible interface on top of RocksDB, so the shared idea is not unique to this project. The difference is in the surrounding machinery. PikiwiDB brings its own replication and clustering story: slaveof with binlog-based full and incremental sync, plus the Codis group model carried in-tree. Kvrocks has its own replication design, and the two are not interchangeable at the operations layer even though both answer Redis commands. Pika is the other name in the search results, and the README's own badge links still point at the Qihoo360/pika repository, which tells you PikiwiDB sits in that lineage rather than being an unrelated effort. Against Redis itself, the split is clean: Redis keeps data in memory and wins on latency for anything that fits; PikiwiDB trades some of that latency for capacity and persistence. Choose on where your dataset is relative to RAM, not on which project has the nicer feature list.

Licence, maintenance, and what an upgrade costs

PikiwiDB is BSD-3-Clause, a permissive licence that generally allows commercial use and modification with the copyright notice retained. That is a friendlier position than copyleft for teams embedding a datastore in a product, but the licence text in LICENSE.md is what governs, and this is not legal advice. Maintenance looks current on the evidence available: the repository is not archived and the last push was on 2026-09-16, days before this writing, with v4.0.4-alpha tagged on 2026-09-01. The upgrade cost is where the release naming bites. The project ships alpha tags alongside numbered releases, and the README does not document a rollback path, so the practical work of an upgrade is reading CHANGELOG.MD and CHANGELOG_CN.MD before you move, checking whether the tag you are jumping to is alpha, and testing against a copy of your data. There is no published support window to lean on, so the changelog and the tests/ directory are the documentation you actually have.

Editorial conclusion

Adopt PikiwiDB when your Redis working set has outgrown a single machine's memory and you still want the Redis command surface, the slaveof replication model, and a Codis-style cluster for scaling. Do not adopt it if your workload is small enough to stay in RAM, if you depend on Redis modules, or if you need a release line the project labels stable rather than alpha. Before committing, verify three things against your own data: that the Redis commands you actually call appear in the supported-interface list, that the v4.0.4-alpha tag is acceptable for the environment you are targeting, and that your build succeeds from build.sh on the platform you deploy to.

Frequently asked questions

Is PikiwiDB a drop-in replacement for Redis?

It is protocol and data-structure compatible rather than a byte-for-byte replacement. The README states it is fully compatible with the Redis protocol and supports common structures such as string, hash, list, zset, set, geo, hyperloglog, pubsub, bitmap, and stream, and it points to a supported-interface page for the exact coverage. Check that page against the commands your application calls.

What storage engine does PikiwiDB use?

RocksDB. The README describes it as a persistent KV system using RocksDB as the storage engine, with a multiple-granularity caching model that keeps hot data in cache while the full dataset is stored persistently. In master-slave mode each data structure uses a separate RocksDB instance.

How do I build PikiwiDB from source?

The repository provides build.sh at the top level along with CMakeLists.txt, and the README lists CentOS, Ubuntu, macOS, and Rocky Linux as supported platforms. Running ./build.sh is the documented entry point; the README does not list every dependency, so a first build may require resolving toolchain packages on your system.

Can PikiwiDB run as a cluster?

Yes, in two modes. The README describes a single-machine master-slave mode using the slaveof command with binlog asynchronous replication, and a distributed cluster mode based on the Codis architecture where multiple groups each form a master-slave set and scaling is done by adding or removing groups.

Is it safe to run the v4.0.4-alpha release in production?

The repository does not document a stability policy or a rollback procedure, so that judgement is yours to make from CHANGELOG.MD and your own testing. The project also publishes non-alpha tags such as v3.5.7 and v4.0.3, which are the alternatives if an alpha tag is not acceptable for your environment.

Official sources

  1. Issues
  2. License: BSD-3-Clause
  3. OpenAtomFoundation/pikiwidb on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/openatomfoundation-pikiwidb.svg)](https://hysenlabs.com/projects/openatomfoundation-pikiwidb)