Load balancer for Object Storage that provides REST API to Create/Delete Buckets and Create/Update/Delete Files.
Implementation of the characterstics of Amazon Dynamo Paper like Consistent Hashing, Sloppy Quorum and Hinted Handoff as REST based Object storage service.
- Python 3
- Cloud Storage Repository
- List of Storage Nodes and their addresses available in the system
- Create a virtualenv
LoadBalancer
and activate it. If you do not have virtualenv installed, install it. (Installation: Windows, Linux & MAC OS) - Clone the Load Balancer repo into the desired directory.
- In the project home folder, Install the necessary packages using the command
pip install -r requirements
. - Create
conf.py
inclouder
folder. - Add the following code to
conf.py
NODE_LIST = [<List of the Storage Nodes>] NODE_ADDRESS = {<Each node in NODE_LIST as key and its corresponding address as its value>} REPLICATION_FACTOR = <Minimum number of replications needed for each read/write>
- Execute the following command to apply migrations:
python manage.py migrate
. - To run the server on local IP assigned with default port, execute the command
python manage.py runserver 0.0.0.0:8000
.
This REST API doesn't have any authentication. To access this API, send a POST request using any request managers like Postman to specified address given below.
- Create Bucket:
- URL:
/create/bucket/
- Request Body: 'name' = - Result:{status: <Success/Failure>, node: <Node at which the bucket was created>}
- Delete Bucket:
- URL:
/delete/bucket/
- Request Body: 'name' = - Result:{status: <Success/Failure>, node: <Node at which the bucket was deleted>}
- Create File:
- URL:
/create/file/
- Request Body: 'name' = , 'bucket' = , 'file' = - Result:{status: <Success/Failure>, node: <Node at which the file was created>, vector_clocks: {<Vector Clock of each node after file creation>}}
- Update File:
- URL:
/update/file/
- Request Body: 'name' = , 'bucket' = , 'file' = - Result:{status: <Success/Failure>, node: <Node at which the file was updated>, vector_clocks: {<Vector Clock of each node after file updation>}}
- Delete File:
- URL:
/delete/file/
- Request Body: 'name' = , 'bucket' = - Result:{status: <Success/Failure>, node: <Node at which the file was deleted>}
You can learn more about APIs and how to use them here.