Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cirello-io/groupcache-experiment
https://github.com/cirello-io/groupcache-experiment
experimental
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cirello-io/groupcache-experiment
- Owner: cirello-io
- Created: 2018-07-02T20:10:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-20T19:34:18.000Z (about 1 year ago)
- Last Synced: 2024-06-19T21:57:03.473Z (5 months ago)
- Topics: experimental
- Language: Go
- Size: 48.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# Groupcache DB Experiment - Revisited 2019
This is the second revision of Capotej's [Groupcache DB Experiment](https://github.com/capotej/groupcache-db-experiment).I decided to replay again his experiment using newer techniques, such the use of go mod, protobuf and error wrapping.
This project simulates a scenario wherein a few frontends running [groupcache](http://github.com/golang/groupcache) are fronting a slow database. See his [blog post](http://capotej.com/blog/2013/07/28/playing-with-groupcache/) about it for more details.
# Getting it running
The following commands will set up this topology:
![groupcache topology](https://raw.github.com/cirello-io/groupcache-experiment/master/topology.png)### Build everything
1. ```git clone https://github.com/cirello-io/groupcache-experiment.git```
3. ```go build ./cmd/backend```
4. ```go build ./cmd/frontend```
5. ```go build ./cmd/cli```### Start DB server
1. ```./backend```
This starts a deliberately slow k/v datastore on :8080
### Start Multiple Frontends
1. ```./frontend -listen "http://localhost:8001" -frontend "localhost:9001" ```
2. ```./frontend -listen "http://localhost:8002" -frontend "localhost:9002" ```
3. ```./frontend -listen "http://localhost:8003" -frontend "localhost:9003" ```### Use the CLI to set/get values
1. ```./cli -set -k foo -v bar```
2. ```./cli -get -k foo``` should see bar in 300 ms
3. ```./cli -get -k foo``` should see bar instantly