Communication via Databases

Learn how databases help with communication in distributed systems.

In any system, data flows from one point to another all the time. You post a status on Facebook, search for something on Google, order a brand new iPhone on Amazon and so on. Every interaction you have with all these different internet services involves data in one way or another. In fact, systems tend to be more data heavy than ever in modern times.

Note: It is crucial that processes (and similarly nodes) efficiently communicate among themselves in a distributed system. These processes can either be on the same node or distributed among many different nodes. The faster the communication, the faster the system can be.

When two processes communicate, one process always hands over some data to the other, or two processes exchange some data between themselves. If this interprocess communication is slow, the system itself might halt. Therefore, it is immensely important that communication be efficient.

In this chapter, we will learn about efficient data movement in distributed systems. Let’s start with using databases for data circulation.

Databases for data flow

Databases are at the core of any system. A process writes some data on the database, and some other process reads it. Sometimes, it does not have to be two different processes doing the reading and writing. The same process can write some data now and read it at a later point in time.

In large systems, it’s actually common that many processes are reading from and writing on the same database side by side. These different processes can be from the same service with more than one instance. They can also be from different individual services. From the perspective of the database, it does not matter much.

Get hands-on with 1400+ tech skills courses.