Skip to content

Instantly share code, notes, and snippets.

@duythinht
Last active May 28, 2020 12:01
Show Gist options
  • Save duythinht/21ffce36d95af194859f3ffef4d883e9 to your computer and use it in GitHub Desktop.
Save duythinht/21ffce36d95af194859f3ffef4d883e9 to your computer and use it in GitHub Desktop.
gRPC

Why gRPC

gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.

  • Simple service definition - Define your service using Protocol Buffers, a powerful binary serialization toolset and language
  • Works across languages and platforms - Automatically generate idiomatic client and server stubs for your service in a variety of languages and platforms
  • Start quickly and scale * Install runtime and dev environments with a single line and also scale to millions of RPCs per second with the framework
  • Bi-directional streaming and integrated auth - Bi-directional streaming and fully integrated pluggable authentication with HTTP/2-based transport

Ref: https://grpc.io/about/

Teko gRPC

Project structure

Look at sample project: https://git.teko.vn/shared/sample

.
├── .dockerignore
├── .envrc
├── .gitignore
├── .gitlab-ci.yml
├── Dockerfile
├── Makefile
├── README.md
├── bin/
├── cmd
│   └── main.go
├── config
│   └── config.go
├── go.mod
├── go.sum
├── migrations
│   ├── .keep
│   ├── 20200505151636_create-table-person.down.sql
│   └── 20200505151636_create-table-person.up.sql
├── model
│   └── .keep
├── pkg
│   ├── .keep
│   └── sampleclient
│       └── client.go
├── rpcimpl
│   ├── health.go
│   ├── sample.go
│   └── server
│       └── rpc-server.pb.go
└── tools.go

Recommandation libs & tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment