/kv-storage-tarantool

Simplest key-value storage accessible over http

Primary LanguageLua

Key-value storage accessible by http

What is it?

This is a key-value storage using Tarantool

📚 Technologies

This project is powered by Lua. Also used:

  • Nginx
  • Docker
  • Tarantool

Known limitations: https is not supported, because http.client does not support it.

✌️ API

Path Method Body (json) Description
/kv POST {"key": "Your key", "value": some json } Add a new tuple in database
/kv/:key GET Select value by key
/kv/:key DELETE Delete tuple if key was in the database
/kv/:key PUT { "value": some json} Update new pair if the key was in the database

You can check the api with the following commands

curl -d '{"key":"Hello", "value": "World"}' -H "Content-Type: application/json" -X POST http://kv-storage-tarantool.site/kv

curl -X GET http://kv-storage-tarantool.site/kv/Hello

curl -d '{"value": "!"}' -H "Content-Type: application/json" -X PUT http://kv-storage-tarantool.site/kv/Hello

curl -X DELETE http://kv-storage-tarantool.site/kv/Hello

📝 Deployment

Docker

  1. Clone this repository
  2. If you have docker-compose installed you can simply run:
cd kv-storage-tarantool
docker-compose build
docker-compose up -d

*Note: tests will run automatically

☑️ TODO

  • Add more tests
  • add dockerfils & nginx

Keywords