#lru #server #store #k-v #binary #🦪

app oysters

Simple HTTP server for the Oysters LRU k/v store

5 releases

Uses new Rust 2024

new 0.1.5 Mar 17, 2025
0.1.4 Mar 17, 2025

#144 in HTTP server

Download history

83 downloads per month

AGPL-3.0-or-later

25KB
437 lines

🦪 Oysters

Oysters is a simple LRU key/value store which operates off an HTTP endpoint. Oysters allows you to persistantly store data by dumping it to an SQLite file.

Usage

You can build Oysters using the following command:

just build

This will compile two binaries: oysters and oysters-cli.

oysters binary

The oysters binary will start the server at port 5072 by default. This port can be changed in the config file:

# ./.config/config.toml
port = 5072

oysters-cli binary

The oysters-cli binary allows you to interface with the server through a CLI.

For example, here's a simple demonstration of inserting a key, fetching the stored value, and then removing the key:

> oysters-cli insert a 1
> oysters-cli get a
1
> oysters-cli remove a

It can also perform more complex operations, such as filtering values by their key:

> oysters-cli insert a:a 1
> oysters-cli insert a:b 2
> oysters-cli insert b:a 3
> oysters-cli insert a:b:c 4
> oysters-cli insert a:b:d 5
> oysters-cli filter a:b:*
a:b:c = 4
a:b:d = 5
> oysters-cli dump # dump the in-memory map into an SQLite file, allowing us to store data persistantly
> oysters-cli scan # scan the in-memory map for keys accessed less than 7 days ago, allowing us to delete stale data

Dependencies

~9–21MB
~289K SLoC