Giter Club home page Giter Club logo

quitsies's Introduction

Quitsies

Quitsies

"Quitsies": allows any opponent to stop the game without consequence. Players can either have "quitsies" (able to quit) or "no quitsies". - Wikipedia

A NoSQL key/value datastore that persists data to the disk using RocksDB. Quitsies aims to deliver high read and write performance in a service that can be quit (and restarted) without consequence.

Quitsies is accessible via a REST API and a subset of the memcached API.

To run:

quitsies [OPTIONS]...

To set a key with HTTP:

curl http://<address>:<http_port>/quitsies/key/<key> -d "<data>"

To get a key with HTTP:

curl http://<address>:<http_port>/quitsies/key/<key>

To set a key over TCP:

echo -e "set <key> 0 0 <data_length>\r\n<data>\r\n" | nc <address> <tcp_port>

To get a key over TCP:

echo -e "get <key>\r\n" | nc <address> <tcp_port>

TTL

Quitsies cannot set TTLs per data item, but can set a global TTL for all data. This works by suffixing all data with a timestamp of when they were last set. When you run quitsies you can use the --db_ttl flag to set a TTL, but be warned that this global value will apply retroactively to existing data.

TTLs are applied at compaction time.

Memcached API

Quitsies implements a subset of the memcached API in order to be compatible with existing libraries. However, since quitsies works differently to memcached under the bonnet there are some unimplemented commands and unused parameters that are worth understanding if you intend to use it.

Currently supported commands and their caveats:

Storage commands: set, add

Storage commands expect the same format from clients as the memcached API:

<command name> <key> <flags> <exptime> <bytes> [noreply]\r\n

However, the <flags> and <exptime> parameters are ignored for now. The cas check and set operation is also not implemented within quitsies.

Retrieval commands: get, gets

These commands are supported and should have parity with memcached.

Deletion command: delete

This command is supported and should have parity with memcached.

Tuning Performance

Quitsies has numerous input flags for tuning performance. The most prolific option is --db_write_mode, which optimises quitsies for writing at the cost of more expensive reads, this option is useful for quickly running a backfill.

Snapshots and Restoration

A running quitsies service can save snapshots into <db_path>_backup. You can trigger a snapshot with the rest API:

curl http://<address>:<http_port>/quitsies/backup_create -X POST

You can list snapshots with:

curl http://<address>:<http_port>/quitsies/backup_info

And you can purge all but the latest snapshot with:

curl http://<address>:<http_port>/quitsies/backup_clean -X POST

Restoring

To restore the latest snapshot in <db_path>_backup to <db_path> you can run quitsies with the --db_restore_backup flag. This will take the latest snapshot and use it to replace <db_path> entirely, so do not restore if there is live data that isn't backed up.

Build Docker

docker build . -t meltwater/quitsies:latest

Development

Build and test with bazel:

bazel test ...
bazel build quitsies

Or, pull the deps manually:

And use the makefile:

make build
make test
make install

quitsies's People

Contributors

jeffail avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.