프리미의 공간

[TIL] 마이크로서비스 간의 통신 종류와 특징 (REST, GraphQL, gRPC) 본문

카테고리 없음

[TIL] 마이크로서비스 간의 통신 종류와 특징 (REST, GraphQL, gRPC)

프리미_ 2025. 9. 28. 18:01

https://journalclub.io/episodes/performance-evaluation-of-microservices-communication-with-rest-graphql-and-grpc

 

Performance evaluation of microservices communication with REST, GraphQL, and gRPC

Now, if you’re like me: alarm bells are already ringing. These shootouts happen all the time, and in many cases the experimental design is seriously flawed. In my opinion, this paper is no exception. So rather than take this article at face value (and re

journalclub.io

REST

  • 데이터 교환을 위해서는 format과 protocol이 필요함
  • REST는 HTTP 프로토콜 위에서 JSON format으로 주고받기에, javascript에 익숙한 웹 개발자들에게 zero learning curve 경험을 제공함

 

GraphQL

  • 데이터뿐만 아니라 relationship도 고려해야하는 graph 데이터에 적합.
  • 정적인 endpoint를 노출하는 것이 아닌 GraphQL을 읽음으로서 underfetching, overfetching 문제해결.
  • 가령, REST라면 최소 3번의 요청(페치)이 필요한데 GraphQL은 1회의 fetch로도 처리할 수 있음.

 

gRPC

  • protobuf 포멧과 HTTP/2 상에서 정의됨.
  • protobuf는 직렬화/역직렬화 오버헤드를 획기적으로 줄이기에 서버간 통신에 적극 활용됨. 학습곡선이 꽤 있음.