Repolode
tidwall

tidwall/pogocache

A low-latency caching server written in C that speaks Memcache, Redis/Valkey, HTTP and Postgres protocols, and can be embedded as a single C file.

Open-source alternative to:RedisMemcached

Stars
2,524
Forks
76
Open issues
18
Last commit
3 months ago

What is it?

Pogocache is a caching server focused on low latency and low CPU use per request. It listens for clients over several wire protocols, including Memcache, Valkey/Redis (RESP), HTTP and Postgres, so existing tools such as curl, redis-cli, psql and common client libraries can connect without changes.

It can also run embedded. The self-contained pogocache.c file can be compiled directly into a C program, which lets the application call the cache functions without going through the network. Server features include TLS on a separate port, password authentication, configurable memory limits with eviction, optional persistence to a file, and sharded hashmaps with per-shard locking.

The project targets 64-bit Linux and macOS and is written in C. Its README includes benchmark tables comparing it with Redis, Valkey, Dragonfly, Garnet and Memcache on a single AWS instance type; those numbers come from the author's own test setup.

Key features

  • 01Accepts Memcache, RESP (Valkey/Redis), HTTP and Postgres wire protocols on one server.
  • 02Can be compiled into a C program as a single file for in-process caching.
  • 03Supports TLS, auth passwords and configurable maxmemory with eviction.
  • 04Offers optional persistence to a file and key expiration with TTL.
  • 05Uses a sharded hashmap with per-shard spinlocks and epoll/kqueue event loops.

Use cases

  • Replacing a Redis or Memcache instance in a latency-sensitive service without changing client code.
  • Embedding a fast key-value cache directly inside a C or C++ application.
  • Using curl or psql as a quick way to inspect and set cache values during development.

Quick start

  1. 1

    Build the pogocache program from source

    make
  2. 2

    Start the server on localhost port 9401

    ./pogocache
  3. 3

    Connect with curl to store and read a value

    curl -X PUT -d "my value" http://localhost:9401/mykey

Things to know

  • Designed and tested only on 64-bit Linux and macOS.
  • The README does not document Windows support.

Topics

FAQ

What is pogocache?
A low-latency caching server written in C that speaks Memcache, Redis/Valkey, HTTP and Postgres protocols, and can be embedded as a single C file. Pogocache is a caching server focused on low latency and low CPU use per request. It listens for clients over several wire protocols, including Memcache, Valkey/Redis (RESP), HTTP and Postgres, so existing tools such as curl, redis-cli, psql and common client libraries can connect without changes.
Is pogocache free to use? What license does it have?
pogocache is open source under the MIT license. Check the license terms before using it in commercial products.
Is pogocache still maintained?
Updated within 6 months. The last commit to pogocache was on Aug 5, 2026.
What can I use pogocache for?
Replacing a Redis or Memcache instance in a latency-sensitive service without changing client code. Embedding a fast key-value cache directly inside a C or C++ application. Using curl or psql as a quick way to inspect and set cache values during development.
How do I install pogocache?
Build the pogocache program from source: make Start the server on localhost port 9401: ./pogocache Connect with curl to store and read a value: curl -X PUT -d "my value" http://localhost:9401/mykey
Where can I get pogocache?
The source code and installation instructions are on GitHub: https://github.com/tidwall/pogocache

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects