It is an example implementation of socket programming in Python3 by recreating the well-known in-memory data storage Redis.
Currently, it has only these commands
- GET
- SET
Also, I implemented encoding and decoding protocols of only
- Integer
- String
- Error
Lastly, it can serve for multiple clients and handling race condition with lock mechanism.
In order to run, please follow these steps:
- Create and activate python3 environment (for virtualenv users):
python3 -m venv venv
source venv/bin/activate
- Go to the project folder:
cd ./byor
- Run the server first with the command:
python -m byor.main run-server
- Now, server is ready to accept connections. And you can open a new terminal/terminals and start using commands.
- Adding value to the db:
python -m byor.main set key1 val1
- Getting (Querying the value of the key):
python -m byor.main get key1