RPC는 IPC의 종류이다
IPC: Inter-Process Communication
IPC에 대한 설명은 여기에서 복습하고 오자!
RPC
Remote Procedure Call (RPC): protocol that provides high-level communications paradigm used in OS
- presumes existence of low-level transport protocol (TCP/IP) for carrying message data b/w communicating programs
- implements a logical client-to-server communications system esigned for support of network applications
- built on top of eXternal Data Representation (XDR) protocol
- XDR: standardizes the representation of data in remote communications
- convers parameters & results of each RPC service
- enables users to work w/ remote procedures as if they are all local
- RPC's routines define remote procedure calls
- each call message is matched w/ reply message
- provides authentication process that identifies server and client to each other
- RPC has a slot for authentication parameters on every RPC so that caller can identify itself to server
- client package generates & returns authentication parameters
gRPC
Google remote procedure call (gRPC): a RPC framework that brings performance benefits & modern features to client-server applications
- allows you to directly call methods on other machines
- fast, efficient, secure, facilitates coding
Origins
RPC calls can be insecure b/c they expose too much internal details to the outside, and it can be very specifically coupled to particular implementations. REST (Representational State Transfer) was designed to solve the problems by providing a common set of methods for client-server communication such as GET
and POST
. Yet, REST is still inefficient because its data has to be serialized for transmission and thus adds performance overhead.
Advantages of gRPC
- Performance benefits: fast
- lightweight messages: better than larger JSOn messages
- appropriate for smart devices and IOT commuication or any other high-frequency communcation
- uses Protocol Buffers format: messages can be exchanged up to 6 times faster than JSON and are compressed & serialized
- low latency: beneficial for microservices
- microservices can communicate efficiency
- connection b/w mobile devices & browsers to backend services
- IPC: efficiency gains over TCP when sending messages b/w services on same machine
- Development speed
- gRPC has autogeneration tools > quickly generates client libraries
Downsides of gRPC
- browser support
- need to use intermediary technology at times
- immaturity: developers are not as familiar with gRPC
- Protobuf encrypted messages can't be ready by humans
- you have to use tools to debug
References