What are Distributed Systems?
- Are a group of independent computers which connect with each other to get a job done.
- They may connect to offer some service, share data or simply store data.
- These computers do not physically share memory or processor.
How do they (computers) communicate?
- They communicate with each other using Messages.
- In a distributed system the sender and receiver must be explicitly encoded in the message.
- Messages are a great way for modular components to communicate. Messages should follow some protocol for consistency. Like in WWW we have HTTP protocol.
- Say we have two computers A and B that can exchange messages.
- Computer A can ask B to compute sum of two numbers and send back the result. Likewise computer B can ask A to sort a list of numbers.
- Both A and B can take different roles depending on their H/W and S/W capabilities.
How can computers be organized?
We can have a Client Server or Peer to Peer architecture.
Here we have a server which provides service to multiple clients.
It’s not just limited to Internet. Even on a single machine this model is applicable. Like a program may need inputs from user. So I/O module functions as a server to the program.
One problem here is that if server goes down then the requests won’t be served. So here our server becomes a single point of failure.
Another problem is if the number of clients increases then the performance will go down.
Client Server model is good for service oriented architecture. But when we want a set of computers to divide the load among themselves then Peer to Peer model is better.
Peer to Peer
This functions more as a distributed system where workload is distributed among the computers.
All computers participate in computation and they send and receive data.
If the system needs to store large amounts of data, it can distribute the same among computers which are participating in this setup.