├── database.csv # database log file
├── log_based_main_hashmaps.py # log based storage engine with hashmaps
├── log_based_main.py # log based storage engine
├── README.md # this file
└── requirements.txt # dependencies
Log based storage engine
This is a simple log based storage engine implementation using FastAPI
Source : log_based_storage_engine
Setup
pip install -r requirements.txt
Run
uvicorn log_based_main:app --reload
API
# set key
curl -X POST http://localhost:8000/set_db -H 'accept: application/json' -H 'Content-Type: application/json' --data '{"key":"42","val":"life"}'
# get key
curl -X GET http://localhost:8000/get_db/42
# returns `life`
# update key
curl -X POST http://localhost:8000/set_db -H 'accept: application/json' -H 'Content-Type: application/json' --data '{"key":"42","val":"answer to life"}'
# get key
curl -X GET http://localhost:8000/get_db/42
# returns `answer to life`
# inspect database
cat database.csv