rest - grpc带rest作为网关有什么好处?
问题描述
像这里描述的那样,将 grpc 作为网关的 grpc 有什么好处 --> https://grpc.io/blog/coreos?
由于 grpc-web 还不够成熟(如这里所述 --> https://docs.microsoft.com/en-us/aspnet/core/grpc/comparison?view=aspnetcore-3.0),因此交互很重要对于浏览器,我也可以使用 REST API 来解决所有问题。
解决方案
REST and gRPC are both tools that fit different use cases. If you have a large enough project that would benefit from a microservice architecture, gRPC provides type safe inter-service communication, performance gains, and automatic server and client stub generation. Imagine never having to implement a HTTP client stub again, for me, that’s the best argument to use gRPC. For REST, there’s code generation tools like Swagger but they’re cumbersome and half of the spec file ends up being HTTP bloat, when I simply just want to call a function on a server. Of course, with gRPC you still need to implement a REST API assuming you need to support browser based clients—but this REST api will be fairly simple and will only have the concern of delegating to the correct gRPC microservices.
推荐阅读
- c# - 代码.net核心的顺序应该是什么?
- c# - 如果 WPF 中已经有内容,我如何跳过第一个按钮?
- php - 所以......目标类不存在......好吗?
- javascript - 使用 render_template 将数据从 Flask 发送到 javascript
- html - 如何折叠所有打开的选择器或 html 元素
- mysql - Colesce 和内连接
- c++ - mktime() 在调用时重新分配堆内存
- flutter - 如何在 Catch Block 中使用 Flutter AlertDialog?扑
- scala - 如何在 (x)ubuntu 20.04 上安装独立的 Scala Spark
- python - Python/pandas:如何正确读取带有编码“cp1252”的西里尔文文本的 csv 文件?