Redis-Alternative is a lightweight, high-performance key-value store designed to provide an alternative to Redis. It supports all the common Redis operations and is accessible via a RESTful API.
To run the project, you have two options: setting up the Drogon environment on your machine or using the provided Docker image.
Follow the resources below to set up the Drogon environment on your machine:
Pull the Docker image from the following location: Docker Image
Then run the image using the command:
docker run -p 8848:8848 aditya292002/redis-alternative:latest
Here are the available features of Redis-Alternative:
Send a POST request to localhost:8848/set
with the data in JSON format. Example:
{
"key": "name",
"value": "Joe"
}
Send a GET request to localhost:8848/get
with the key as a query parameter.
Example: localhost:8848/get?key=name
Send a PATCH request to localhost:8848/patch
with the key and new value as query parameters.
Example:
localhost:8848/patch?key=name&value=adi
Send a DELETE request to localhost:8848/del
with the key as a query parameter.
Example: localhost:8848/del?key=name
Send a DELETE request to localhost:8848/flush
.
Example: localhost:8848/flush
Send a POST request to localhost:8848/expire
with the data in JSON format.
Example:
{
"key": "name",
"seconds": 60
}
- Python Client (python_client.py): Contains a class (KeyValueStoreClient) with methods to interact with your API (store_value and retrieve_value).
- CLI Client (cli_client.py): Uses argparse to provide a command-line interface. This file imports and uses the KeyValueStoreClient to handle the API requests based on user input.
Python Client Usage:
from interface.python_client import KeyValueStoreClient
client = KeyValueStoreClient()
client.store_value('name', 'aditya')
print(client.retrieve_value('name'))
CLI Client Usage:
python3 interface/cli_client.py store name --value aditya
python3 interface/cli_client.py retrieve name
-
Contact
-
For any questions or suggestions, please open an issue or contact the project maintainer.
-
Maintainer
-
Email: [email protected]