GitXplorerGitXplorer
T

stored

public
5 stars
1 forks
25 issues

Commits

List of commits on branch master.
Unverified
dfde01656dde8ea2d346c84570f79d2129edee54

Update ring version

TThomasdezeeuw committed 4 years ago
Unverified
5a6907063235eab4df36e6c9ed2a7df7630b91bd

Use madvise with MADV_RANDOM on the mmaped data file

TThomasdezeeuw committed 4 years ago
Unverified
b9c83907bb60f9b6e8096f9317948f20ed8230a7

Add timeout to process signal message

TThomasdezeeuw committed 4 years ago
Unverified
ff4fccc6f42f8a7a97629d62a8712879e7755c07

Replace AsyncWrite::write calls with TcpStream methods

TThomasdezeeuw committed 4 years ago
Unverified
adeeb4f1122c9e4ea26f52b91296e8ccc3fb1243

Add my thesis

TThomasdezeeuw committed 4 years ago
Unverified
88b22c1466d107e01ea072ffb3f0b3ac79116236

Small cleanup

TThomasdezeeuw committed 4 years ago

README

The README file for this repository.

Stored

Stored is an experimental prototype not to be used in production!

Stored (pronounced store-daemon, or just stored) is a distributed immutable blob store. Stored is not a key-value store, as the key isn't the decided by the user but by the SHA-512 checksum of the stored blob.

It supports three operations: storing, retrieving and removing blobs. As the key of a blob is its checksum it is not possible to modify blobs. If a blob needs to be modified a new blob simply needs to be stored and the new key used. The client can validate the correct delivery of the blob by using the returned key (checksum). The blob themselves are unchanged by Stored.

Operations

Stored supports three operations; storing values, retrieving values and removing values. But first we need to start the server.

Starting the server

Starting the server is simple, just call stored with a path the configuration file. See config.example.toml for all configuration options.

$ stored config.toml

Next we look at how to interact with stored.

Storing a value

Storing values can be done with the store command. The commands returns the key of value.

# Using the first argument
$ store "Hello world"
# Without arguments it reads from standard in.
$ echo "Hello world" | store

But since stored exposes an HTTP interface we can also use a tool like curl to store values using a POST request.

# Store "Hello world".
curl -X POST -d "Hello world" -v http://127.0.0.1:8080/blob
# Store the contents of some_file.txt.
curl -X POST -d "@some_file.txt" -v http://127.0.0.1:8080/blob

Retrieving a value

Getting a value can be done using the retrieve command.

$ retrieve $key

Or using the HTTP interface using curl.

# Retrieves "Hello world".
curl http://127.0.0.1:8080/blob/b7f783baed8297f0db917462184ff4f08e69c2d5e5f79a942600f9725f58ce1f29c18139bf80b06c0fff2bdd34738452ecf40c488c22a7e3d80cdf6f9c1c0d47

Removing a value

Removing a value can be done with remove command.

$ remove $key

Or a simple DELETE request.

# Deletes "Hello world".
curl -X DELETE http://127.0.0.1:8080/blob/b7f783baed8297f0db917462184ff4f08e69c2d5e5f79a942600f9725f58ce1f29c18139bf80b06c0fff2bdd34738452ecf40c488c22a7e3d80cdf6f9c1c0d47