Grpc+protobuf learning notes I. Preface

Time:2022-6-19

cause
Back to earth for a raiseGrpc+protobuf learning notes I. Preface
This note is only a summary of work and study. If you have any questions, you can leave a message for communication and exchange learning

Introduction to grpc

  1. RPC framework based on http2.0 protocol
  2. Multilingual support
  3. Defining services based on protobuf

PHP needs to install extensions

Introduction to protobuf

  1. Compared with XML and JSON formats, protobuf is smaller, faster, more convenient and has high transmission performance
  2. Multilingual support

When using protobuf’s tool protoc, you need to install the PHP extension package

summary
For PHP, there are several problems:

  1. Grpc+protobuf can only be used as a client and not a server for PHP
  2. PHP extensions (grpc) and composer packages (grpc and protobuf) need to be installed
  3. The grpc code generated by protocol for PHP requires protocol to install the extension, and windows cannot implement it
  4. Due to the strong type differences of other languages, the parameters during transmission are basically implemented through class methods, and the classes generated by protobuf are converted

It is convenient for go, and there is nothing complicatedGrpc+protobuf learning notes I. PrefaceGrpc+protobuf learning notes I. Preface

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Social networking, pan entertainment applications overseas gold rush, how to pass the “cultural pass”?

(click to register) The scenery at sea is very good. Beware of being trapped in the “cultural” reef.Follow [rongyun global Internet communication cloud] to learn moreRecently, seagoing e-commerce, one of the largest online shopping websites in Southeast Asia, caused an uproar. The platform uses a cross gender online celebrity with complex reviews and a woman […]