POC for next generation cloud native micro service using gRPC. grpc-gateway is used to translate between REST to gRPC when needed.
The benefits of the architecture:
- standardized interface spec
- more express and powerful than REST
- better performance with binary based protocol
- cloud native, integrates seamlessly into K8S
- account service that supports both gRPC and REST, written in Go. Scaffolding by grapi
- gRPC client for account service
- test data generator using Python library mimesis
- benchmark program using Locust and Boomer slave written in Go
- Go 1.13
- MongoDB server 4.2 test data. Any Python 3.7 installation will do
- minikube, your local Kubernetes cluster for testing
- skaffold, think of
npm serve
for K8S development - GitHuab actions workflow is used to build and publish docker images on Github Package Registry.
Install MongoDB server 4.2 then
# populate test data
# this will import 1 json document into dev db, accounts collection
cd benchmark
mongoimport -u dev -p dev --db=dev --collection=accounts < benchmark/seed.json
To quickly try the setup including Prometheus and Grafana but without installing Go and compile and etc,
- minikube
- make sure your /etc/hosts contain an entry called vmhost.localm which is used by db.yaml
- Run
cd k8s; ./all
- Open browser to grafana and Locust by getting url with
minikube service grafana --url
minikube service locust --url
The docker public images below should work for this purpose.
To be written. contributors welcome
# these steps are not yet tesed
# populate test data..
mongoimport -u dev -p dev --db=dev --collection=accounts < benchmark/seed.json
docker run -n account-svc docker.pkg.github.com/sloppycoder/ngms/account-svc:latest
docker run -n locust docker.pkg.github.com/sloppycoder/ngms/benchmark:latest