- Building Microservices with Go
- Nic Jackson
- 210字
- 2021-07-15 17:28:14
Protocol Buffers
Protocol Buffers are a Google product, and they have just entered their third revision. Protocol Buffers take the approach of providing a DSL that the generator (written in C) reads and can generate client and server stubs for over ten languages, the primary ten are maintained by Google and encompass: Go, Java, C, JavaScript for NodeJS.
Protocol Buffers is a pluggable architecture, so it is possible to write your own plugins to generate all kinds of endpoints not just RPC; however, RPC is the main use case as they are coupled to the gRPC framework.
gRPC was designed by Google to be a fast and language agnostic RPC framework, which originated from an internal project where latency and speed were of the utmost importance in Google's architecture. By default, gRPC uses protocol buffers as the method for serializing and de-serializing structured data. An example of this DSL is shown in the following example.
Protocol buffer service definition:
service Users {
rpc CreateUser (User) returns (Error) {}
}
message User {
required string name = 1;
required int32 id = 2;
optional string email = 3;
}
message Error {
optional code int32 = 1
optional detail string = 2
}
Find more information on Protocol Buffers at https://developers.google.com/protocol-buffers/.
- Designing Machine Learning Systems with Python
- 控糖控脂健康餐
- Mastering Concurrency in Go
- 算法訓練營:入門篇(全彩版)
- Python Geospatial Development(Second Edition)
- Linux環境編程:從應用到內核
- Learning OpenStack Networking(Neutron)(Second Edition)
- Serverless computing in Azure with .NET
- 從零開始學C語言
- 從零開始學Linux編程
- Java程序員面試筆試寶典(第2版)
- Frank Kane's Taming Big Data with Apache Spark and Python
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- Troubleshooting Citrix XenApp?
- Python 3 數據分析與機器學習實戰