grpc node.js_使用Node.js构建gRPC服务

grpc node.js

With gRPC, is has made it easier for a client application to directly call a server application on a different machine as if it were a local object. The idea of gRPC is defining the service with methods in the Protobuf file, then the server needs to implement the defined methods, so the client application able to call these services by using the defined methods.

使用gRPC,可使客户端应用程序更轻松地直接在其他计算机上调用服务器应用程序,就好像它是本地对象一样。 gRPC的想法是使用Protobuf文件中的方法定义服务,然后服务器需要实现定义的方法,因此客户端应用程序可以使用定义的方法来调用这些服务。

为什么gRPC比REST好? (Why gRPC is better than REST?)

数据序列化 (Data serialization)

The data transfer in GRPC is using binary format compare to REST that is in text format. GRPC is using protocol buffer to serialize the data., it can help the data to be smaller and faster in comparison to REST which is using plain text that can be huge.

与文本格式的REST相比,GRPC中的数据传输使用二进制格式。 GRPC正在使用协议缓冲区来序列化数据。与使用纯文本的REST相比,它可以帮助数据变得更小,更快。

使用HTTP / 2与HTTP / 1进行比较 (Utilize HTTP/2 compare to HTTP/1)

Although REST can su

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值