This is a simple distributed key-value store with multiple nodes hosted on Render. Note: Since nodes are hosted on Render’s free tier, there is a 50-second bootup time after inactivity.
Follow these steps:
- Open the
index.js
file. - In the
add_node
function, replace<fill_me>
with your public IP address. This will add/sync the node with the distributed key-value store network. - Start the server.
Sample Request:
https://distributed-key-value-1.onrender.com/api/get?key=hey
Sample Request:
curl --location 'https://distributed-key-value.onrender.com/api/put' \
--header 'Content-Type: application/json' \
--data '{
"hey": "there"
}'
To fully utilize multiple threads, you can use PM2.