Skip to content

goodhamgupta/pyminikvstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyminikvstore

Implementation of a robust and production-level KV store. This is a built using the screencast by George Hotz availabe here with a few changes to the design.

This implementation will store KV pairs. It is like nginx has but with filenames as MD5 hash and the real key present in the xattr of the file.

Implementation

  • It will ahve two endpoints:
  • PUT:
    • Put a value in the store.
    • Blocking operation.
    • If 200 => Key written.
    • Anything else => Key was not written
  • GET:
    • Fetch the value for a key
  • DELETE
    • Delete a key from the DB. - We will be using LevelDB for the KV store.
  • Caevats
    • Only one process can open the DB at a time

Types of servers

  • Master
    • Keeps track of the metadata i.e the keys
  • Volume
    • Responsible for actually storing the data

Running the server

./server.sh /tmp/cachedb
./volume.sh /tmp/volume1
./volume.sh /tmp/volume2

Notes

  • reload-mercy and worker-reload-mercy help kill the uwsgi workers faster. Refer the github thread present here

Usage

curl -L -X PUT -d ever http://localhost:3000/greatest
curl -L -X GET http://localhost:3000/greatest
curl -L -X DELETE http://localhost:3000/greatest

About

Implementation of a production grade KV store

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published