Skip to content

NokiaTh131/grpc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRPC Example

Showcase of grpc in golang for full techstack example

techstack

  • grpc
  • sqlite
  • gorm

architecture

  • user-service
  • order-service

user-service

Simple user service with its own database

  id PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) NOT NULL,

order-service

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,

APIs-gateway

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.

(optional) gRPC-gateway

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.

Run

Go to each service directory and run

$ go run cmd/main.go

Diagram

gRPC-example

About

example of microservices with grpc implementation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published