Giter Site home page Giter Site logo

grpc-learn's Introduction

gRPCテストコード

ディレクトリ 内容
grpc-be Unary gRPCサーバ
grpc-fe Unary gRPCサーバのクライアント
grpc-stream-be ServerStreaming gRPCサーバ
grpc-stream-fe ServerStreaming gRPCサーバのクライアント
http-be 比較用HTTPサーバ
http-fe 比較用HTTPサーバのクライアント

gRPCについて

image

  • Googleが開発したRPCフレームワーク。(2015年に発表され、2016/8にVersion1.0がリリースされた)
  • 同社が開発したProtocol BufferというIDLからクライアント・サーバサイドの通信レイヤーのソースコードを自動生成できる
  • 通信プロトコルはHTTP/2
  • 高いパフォーマンスの持つアプリケーションを低コストで開発できる
  • Protocol Bufferでデータスキーマも異なるアプリケーション・言語をまたいで同一のコードを使う為、巨大なマイクロサービスシステムとも相性が良い
  • 対応言語的にiOSやAndroidなどのクライアントサイドでも使える。ただ、その場合クライアントが対応している通信プロトコルとgRPC(HTTP/2)の互換性を持たせる為のプロキシ(grpc-gateway)が必要になる。
  • https://github.com/grpc/grpc-web ではブラウザ上のJSでそのまま扱う事ができる(HTTP/2に対応しているブラウザが必要)

事例

  • Googleは社内のアプリケーション間通信はほぼgRPCと言われている。それ以外でもSquare,Netflix,Ciscoなども
  • 国内ではメルカリやAbemaTVなどは実績がある
  • (2年前に調べたきりだから今はもっと多いと思う)

通信仕様

https://grpc.io/docs/guides/concepts/

  • Unary RPC もっともシンプルな形式。単一のリクエストに対して単一のレスポンスを行う
  • Server streaming RPC 単一のリクエストに対して、連続するデータをレスポンスし続ける。サーバ側のコマンドにより終了する
  • Client streaming RPC Server streamingとは逆で、連続する複数データをリクエストし続ける。クライアント側からの送信が終了したのち、サーバから単一のレスポンスを行う
  • Bidirectional streaming RPC サーバ・クライアント双方から複数のデータの送信を連続で行う

grpc-learn's People

Contributors

taotao2345 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.