Showcase of grpc in golang for full techstack example
techstack
- grpc
- sqlite
- gorm
- user-service
- order-service
Simple user service with its own database
id PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,Simple order service with its own database
id PRIMARY KEY,
user_id INT NOT NULL,
item_name VARCHAR(255) NOT NULL,
total_price FLOAT NOT NULL,
quantity INT NOT NULL,Client of internal services. Provide Auth, Rate Limit, Request Aggregation and Protocol Translation (not implemented). Consider to use ready to use proxy like Envoy, Kong, Nginx.
gRPC-Gateway is a plugin of protoc. It reads a gRPC service definition and generates a reverse-proxy server which translates a RESTful JSON. allow each service to provide APIs in both gRPC and RESTful style at the same time.
Go to each service directory and run
$ go run cmd/main.go