Published in


System design — Communication

Client server communication

OSI Model — Open System Interconnection Model

Hypertext Transfer Protocol (HTTP)

Transmission Control Protocol (TCP)

TCP connection teardown

User Datagram Protocol (UDP)

UDP request-response
  • Time-sensitive applications prefer UDP because of lowest latency
  • Delayed data is far worse than loss of data/unreliable transfer
  • User wants to implement error correction within application

Remote Procedure Call (RPC)

Breakdown of RPC protocol
  1. When the program that uses remote procedure code is compiled, a stub is generated that is a representative of the remote procedure code.
  • Internal mechanism of RPC is hidden from user
  • Supports process-oriented and thread-oriented models
  • Can work in distributed and local environment
  • Clients is tightly coupled with the server
  • Can be difficult to debug RPC
  • Increase in cost due to additional calls

Representational State Transfer (REST)

REST request and response
  • More fields might be added in response with time. Even the clients who don’t need new fields, will still receive new payload resulting in increasing latency and bloated payload size.
  • REST typically relies on few operations -GET, POST, DELETE, PATCH and PUT. This might result in some use case that doesn’t fit these operation.
  • Not all resources can be accessed with REST. Only resources that are naturally organized in simple hierarchy can be accessed.
  • Fetching complicated resources with nested hierarchical might result in multiple rounds between client and server to render single view
  • RPC only uses GET, POST http calls, while REST uses GET, POST, PUT, DELETE and PATCH.
Difference between RPC and REST calls



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Master's student in Computer Science from University of Florida. I love to write and help others, so here am i.