Josh Baker announced a new project github/tidwall/pogocache .
Pogocache is fast caching software built from scratch with a focus on low latency and cpu efficency.
Faster: Pogocache is faster than Memcache, Valkey, Redis, Dragonfly, and Garnet. It has the lowest latency per request, providing the quickest response times. It’s optimized to scale from one to many cores, giving you the best single-threaded and multithreaded performance.
Embeddable: Optionally instead of running Pogocache as a server-based program, the self-contained pogocache.c file can be compiled into existing software, bypassing the network and directly accessing the cache programmatically. Running embedded provides raw speed, with over 100M ops per second.
There is a design details section in the README. Crucial component of the performance is a sharded hashmap based on another Josh’s project shardmap . He also published benchmarking tooling used for comparison.
Another interesting feature is support for different APIs – it emulates Redis and Memcached protocols, as well as psql wire protocol and simple http.
❯ curl -X PUT -d "my value" http://localhost:9401/mykey
Stored
❯ telnet localhost 9401
Connected to localhost.
KEYS *
*1
$5
mykey
GET mykey
$8
my value
QUIT
+OK
Connection closed by foreign host.
❯ psql -h localhost -p 9401
psql (17.5 (Debian 17.5-1), server 1.0.0-1-g9c2a173 (Pogocache))
WARNING: psql major version 17, server major version 1.0.
Some psql features might not work.
Type "help" for help.
bobek=> GET mykey
bobek-> ;
value
----------
my value
(1 row)
bobek=> SET mykey 'another value';
SET 1
bobek=> \q
❯ curl http://localhost:9401/mykey
another value
And it supports time-to-live on keys! Even via http interface via ttl
param:
❯ curl -X PUT -d "temporal flux" 'http://localhost:9401/mykey?ttl=10'
Stored
❯ curl http://localhost:9401/mykey ; echo -e '\n\n-----\n' ; sleep 10 ; curl -i http://localhost:9401/mykey
temporal flux
-----
HTTP/1.1 404 Not Found
Content-Length: 11
Connection: Close
Not Found
Josh has other very interesting projects on his GitHub. Like tile38 real-time geospatial and geofencing server:
Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofencing server. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.