💾 Archived View for gemini.panda-roux.dev › log › entry › 63 captured on 2023-01-29 at 02:32:49. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

MoonGem 2.3 - Key/Value Store

Posted on Tuesday August 2, 2022

MoonGem 2.3 includes an in-memory key/value store. This allows for keeping persistent state across requests.

The entire feature is abstracted into the `mg.store` Lua table. Any primitive value stored in that table will be persisted in-memory and available to subsequent requests.

I used the popular and very fast Wyhash library in order to compute key hashes.

Collision resolution is handled via linear probing. This approach guarantees very fast insertion and lookups in exchange for a necessarily low load factor (and therefore higher memory usage than other methods).

Here's the commit wherein I added this feature

- panda-roux -

next: "Budgeting Strategy"

prev: "Finally Moved"

Email me about this post

Leave a comment

index

home