GithubHelp home page GithubHelp logo

asif001 / rest-key-val-store Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 346 KB

A RESTful-API to store arbitrary length key-value

Dockerfile 4.69% Python 92.92% Shell 2.39%
django-rest-framework django python3 redis json restful-api docker

rest-key-val-store's Introduction

REST key-val Store

Python Package Dependencies

  1. Django
  2. djangorestframework
  3. msgpack
  4. django-redis
  5. redis

Introduction

In this project a REST API has been developed. The target of the API is to store, fetch and update arbitrary length key:value.

Features

  • Store arbitrary length key-val
  • Every key has default TTL 5 min. After 5 minutes the store key is automatically deleted
  • On every GET or PATCH request, the corresponding keys' TTL is reset to default

Quick start running the project

Docker

git clone https://github.com/asif001/REST-key-val-store.git
  • Change directory to REST-key-val-store
  • Launch CLI
  • Run the docker services
docker-compose up -d
  • See the logs
docker logs <container_name> -f

Linux

git clone https://github.com/asif001/REST-key-val-store.git
  • Change directory to REST-key-val-store
  • Create environment for python-3.7.5
  • Activate the environment
  • Install required packages in the environment
pip install -r requirements.txt
  • Run migration
python manage.py makemigrations && python manage.py migrate
  • Start the server
python manage.py runserver

Instructions

  • POST
URL: https://127.0.0.1:8000/api/values
#Format: {key1:val1, key2:val2, key3:val3, ...}
  • GET
#Fetch all values           
URL: https://127.0.0.1:8000/api/values
#Fetch specific key values
URL: https://127.0.0.1:8000/api/values?keys=key1,key2,key3,..
  • PATCH
URL: https://127.0.0.1:8000/api/values
#Format: {key1:val1, key2:val2, key3:val3, ...}

Performance

Performance has been tested using APACHE JMeter

Contributing

The main reason to publish something open source, is that anyone can just jump in and start contributing to my project. So If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Author

Asifur Rahman [email protected] Student at Department of Computer Science and Engineering Khulna University of Engineering & Technology, Khulna Bangladesh

rest-key-val-store's People

Contributors

asif001 avatar

Stargazers

Abrar Hasin avatar

Watchers

James Cloos avatar  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.