https://github.com/aveek-saha/two-phase-commit
A consistent distributed KV store that implements the two phase commit protocol, written in java, using gRPC
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.9%) to scientific vocabulary
Keywords
Repository
A consistent distributed KV store that implements the two phase commit protocol, written in java, using gRPC
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
Two Phase commit
This project is an implementation of the two phase commit protocol in a distributed key value store. The project uses maven as a build tool and gRPC for communication.
The server can be replicated to any number of instances and the data in the Key Value store will remain consistent across replicas.
The system has specifications as follows: - Three types of operations should be performed on the server with the following parameters: - PUT (key, value) - GET (key) - DELETE (key) - Server is multi threaded and can respond to multiple clients at a time. - The server is replicated across multiple instances - The two phase commit protocol is used to maintain consistency across these replicas - The Coordinator handles timeouts in the case of unresponsive servers
The client package has a benchmark which executes 100 of each type of request in parallel and also contains an example of usage.
Running instructions
This repo includes a client and server project containing the client and server respectively.
This project has to be run with Docker and Docker compose which will recreate a coordinator and the specified number of server replicas.
Run with Docker Compose
```sh
Run the docker compose command
This will create the network, start the coordinator and the specified number of replicas
docker compose up
Run: 'docker compose down' when you want to remove the resources created above
Build client image
docker build -f client.Dockerfile -t client-img --target client-build .
Run client container
docker run -it --rm --name client-con --network project3_default client-img java \ -jar /app/client.jar project3-server-3 5001
If the above command doesnt work (it didn't work for me on windows git bash) try this one
docker run -it --rm --name client-con --network project-net client-img \
java -jar //app//client.jar server-con 5001
```
Since I'm using a windows system I haven't tested the bash scripts, but I have modified them to reflect the steps above
sh
./run_client.sh 5001
If you want to change the number of replicas edit compose.yaml and rerun the commands.
Dockerfile
replicas : 10
To change the ports that the servers run on you can also edit compose.yaml
```Dockerfile
coordinator:
...
entrypoint: java -jar /app/server.jar c
server:
...
entrypoint: java -jar /app/server.jar coordinator
Run with Docker
If for some reason you are unable to get Docker compose working, Docker can be used along with the shell scripts. However it is more inconvenient to set up and manage so Docker compose is still the recommended way.
```sh
This script will build and start the coordinators and servers and
then display logs from the coordinator
./deploy.sh
To view logs from any of the 5 servers
docker logs project3-server-<1-5> -f
Run the client
./run_client.sh project3-server-<1-5> <5001-5005> ```
Owner
- Name: Aveek Saha
- Login: Aveek-Saha
- Kind: user
- Location: Boston, MA
- Company: @akamai
- Website: home.aveek.io
- Repositories: 66
- Profile: https://github.com/Aveek-Saha
Cloud Computing, Machine Learning and Full Stack. SDE co-op @akamai. MSCS student @northeastern. Previously at @HewlettPackard, @altimetrik & @ IIT Kgp.
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/setup-java v3 composite
- marvinpinto/action-automatic-releases latest composite
- org.apache.tomcat:annotations-api 6.0.53 provided
- com.google.protobuf:protobuf-java 4.26.1
- io.grpc:grpc-netty-shaded 1.62.2
- io.grpc:grpc-protobuf 1.62.2
- io.grpc:grpc-stub 1.62.2
- org.json:json 20240205
- org.apache.tomcat:annotations-api 6.0.53 provided
- com.google.protobuf:protobuf-java 4.26.1
- io.grpc:grpc-netty-shaded 1.62.2
- io.grpc:grpc-protobuf 1.62.2
- io.grpc:grpc-stub 1.62.2
- org.json:json 20240205