Chapter 2. Protocols

There are various methods a process can use to communicate with other processes. As an example of this, consider communication by reading and writing to the filesystem or by using Inter-Process Communication (IPC). But with these approaches, it’s only possible for a process to communicate with other processes on the same machine.

Instead, processes are typically built to communicate directly with the network. This still allows for communication between processes on the same machine, but more importantly, it allows processes to communicate across a network. There are limited resources available to any given machine and far more resources available across multiple machines.

Note

Jeff Bezos mandated in the early 2000s that Amazon services must expose APIs over the network. This is credited as transforming Amazon from a simple bookstore to the cloud behemoth that is AWS. This pattern is now embraced by tech companies everywhere, allowing teams to access data and innovate at an unprecedented rate.

A protocol is a standardized format for communicating between two parties. When communication happens without protocols involved, it’s inevitable that messages either won’t be interpreted correctly or won’t be understood at all. It’s almost always better to adhere to an industry standard than to create a protocol from scratch. It’s also better to embrace a smaller number of inter-service protocols within an organization to reduce the amount of implementation ...

Get Distributed Systems with Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.