The project is built on top of of groupcache-db-experiment with etcd support.
This project simulates a scenario wherein a few frontends running groupcache are fronting a slow database. For more detail, See capotej blog post about it for more details.
The following commands will set up this topology:
git clone git@github.com:senarukana/groupcache-example
sh build.sh
The default port of etcd is 4001
cd dbserver && ./dbserver
This starts a delibrately slow k/v datastore on :8000
cd cacheserver
./cacheserver -port 8001
./cacheserver -port 8002
./cacheserver -port 8003
You could use -etcd-addresses to assign the port of your etcd server.
SET; Set the data to db CGET: Get the data from the groupcache GET: Get the data from db
cd cli
- ```./cli set foo bar``
./cli get foo
should see bar in 300 ms./cli cget foo
should see bar in 300ms (cache is loaded)./cli cget foo
should see bar instantly
See capotej blog post for more details.