Settings

Theme

Show HN: Pogocache – Fast caching software

github.com

93 points by tidwall 10 months ago · 29 comments

Reader

drewda 10 months ago

Always great to see his open-source creations, like:

- a Redis like cache purpose built for real-time spatial locations: https://tile38.com/

- go package for reading JSON: https://github.com/tidwall/gjson

simonw 10 months ago

I thought I recognized the tidwall name - Josh is also responsible for tg which is a really neat, very tight C geospatial library: https://github.com/tidwall/tg

simonw 10 months ago

Supporting HTTP, Redis and PostgreSQL protocols at the same time is a neat trick!

  psql -h localhost -p 9401
  => SET mykey 'my value';
  => GET mykey;
  => DEL mykey;
jasonthorsness 10 months ago

The README doesn’t seem to explain _why_ it is faster. Is it just highly hand-optimized? Is there some main technique used?

  • tidwallOP 10 months ago

    Yes, it is highly hand optimized. There's a description of some of the methods I used near the bottom of there README. I mainly focused on minimizing contention, with the sharded hashmap and such. But the networking layer is carefully crafted.

stevelacy 10 months ago

Congrats on launching! Was following along with the development, glad to see it launched

nodesocket 10 months ago

Very interesting. Like the idea of using http, redis, or even PostgreSQL clients.

Is there a way to provide the auth password via an envar instead of a command line arg?

    pogocache --auth mypass
  • tidwallOP 10 months ago

    That's the only way right now. The other ways I'm considering is with an environment variable and/or acl.

    • sureglymop 10 months ago

      May I suggest the ability to specific a path to a file that it is then read from.

      • tidwallOP 10 months ago

        Like an ACL file?

        • sureglymop 10 months ago

          No, like a path to a file containing the secret/passphrase that the program can then read it from. I am not a fan of putting secrets directly into environment variables.

          Environment variables are prone to leak or be passed to child processes when it is not desired. But if they are just a file path/pointer to where the secret is, that is mitigated somewhat as one then would still need access to that file.

lormayna 10 months ago

Is the name related to Tadej Pogacar?

Imustaskforhelp 10 months ago

Really looks fascinating.. Might need a deeper dive.

Also.. like, it says that you plan on supporting sql? is this true? What does that actually mean really since I guess it might then compete with things like sqlite/duckdb?

Genuinely curious, great project! Starred!

zikani_03 10 months ago

Always excited to see Josh's projects - last time I played with uhaha (loved the name) and it was mind-opening to some extent. Pogocache also looks very interesting and good to see the benchmarks on ARM

squirrellous 10 months ago

Congrats! Would you mind sharing what part of the design makes this faster than the competitors?

  • tidwallOP 10 months ago

    Thanks! The Pogocache sharded hashmap design is optimized for extremely low contention and good memory locality. It super rare for any two threads to ever wait on the same key. That's the biggest part and it's all in the src/pogocache.c file. But the network layer is finely tuned too.

    Mostly I perfed and profiled ad nauseam, monitoring cpu cycles along the way. I found that keeping a focus on latency and cycles was primo, and the rest fell into place.

SquidJack 10 months ago

very nice

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection