| assets | ||
| examples/c | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
smore - Memory Store
smore is a blazingly fast in-memory key value cache. It works via a custom
protocol and a lot of hopes and dreams. All keys are valid ASCII strings
and values are just streams of bytes.
Features
Written in Zig, this in-memory Cache is blazingly fast. It publishes a Client
implementation as a Zig-Module, as well as a shared library with C-bindings to
be used in any other programming language, that can handle C. It uses a custom
binary protocol, which is defined in src/protocol/.
In the examples/ directory, there will be example implementations using the
C-bindings in other languages. If your favourite language is missing, feel free
to contribute!
The protocol currently supports only very basic operations:
- PING
- STORE
- LOAD
the keys for the store are all 8 bytes long, even if the actually used bytes of the key are less. The rest will be filled with zeros.
The Data can be at most 1024 - 1 - 8 - 2 = 1013 bytes long, where the actual length is transmitted in the respective packets. The maximum length is made up from a packet size of 1024 minus the header, key and data length fields.
Why UDP
Honestly, because i felt like it.
"Actual" reasons:
- This is a cache, the worst that can happen on a dropped packet is a recalculation of the value. This Service should not be used as an actual data-storage
- Faster, Simpler and more lightweight than TCP
Notes/Ideas for development
-
Main implementation in Zig, server and client
-
client implementation as a library
-
try out with UDP
-
Make an alternative implementation using TCP and benchmark performance
-
simulation testing for cases of misordered, dropped UDP Packets