Fridge is an immutable key-value store. It usually stores values as files on disk, but the storage layer can be swapped out for e.g. a relational database or an in-memory store.
You'll need Ruby 2.7.1 installed via rbenv.
One-time setup (the standard Ruby stuff):
gem install bundler
bundle
To run the tests:
make
To run the development server:
make run
To run just the unit tests:
make unit
A Fridge database is versioned. Any change to a value creates a new, incrementing revision number, which is returned from the API call.
You can ask for the value corresponding to a key as of a particular revision. Details of the API are below.
PUT /values/foo HTTP/1.1
Content-Type: text/plain
Hello, world!
Response:
{
"revision": {
"id": 1
},
"timestamp": "2020-01-01 17:45.678Z"
}
GET /values/foo HTTP/1.1
Response:
Hello, world!
GET /values/foo?revision=1
Response:
Hello, world!
GET /values/foo?revision=0
Response:
404 Not Found
GET /values/foo?time=2020-01-01
GET /revisions?limit=50&mostRecent=100
Filtering by date:
GET /revisions?limit=50&before=2020-01-01
Response:
{
"revisions": [
{
"id": 1,
"timestamp": "2020-01-01 17:45:01.789Z",
"change": "create",
"key": "foo"
}
]
}
DELETE /revisions/10
This deletes revision 10 and every earlier revision.