# Blockchain Basics

The base of a blockchain is a set of computers (nodes) and network. This is nothing but a classic distributed systems. Distributed systems have been around for many decades then why was blockchain not implemented earlier? The answer is the challenges in distributed system which made things more complicated for blockchains where untrusted parties had to communicate.

Before getting into these lets look at different distributed architecture\
1\) Server Client Architecture\
2\) Federated server architecture\
3\) Distributed peer to peer architecture

Figure 1 shows Server client architecture. There is one central server and all clients talk to this. This is very much used in many applications today. However this is not suitable in blockchain as we don't want one central server.&#x20;

![Classic Client Server](https://3601662095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjEiWbDLtVOiXJWwYTIn2%2Fuploads%2FK02oMxiyxoWq3kE6hLfr%2Fimage.png?alt=media\&token=a623ad70-ae41-45f2-bce7-2e62b22a5727)

Figure 2 shows the Federated server architecture. In this case instead of one single server, there are multiple servers and they talk to each other. The other clients connect to one of the Federated server. These federated servers connect to one main server. This is not an ideal architecture for blockchain. If one server fails then all the clients connected to that server will get disconnected. \\

<figure><img src="https://3601662095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjEiWbDLtVOiXJWwYTIn2%2Fuploads%2FpK9JSwxMkVKcgs4li8G5%2Fimage.png?alt=media&#x26;token=0d6f24d6-09c3-488d-b6ac-9181e2557414" alt=""><figcaption><p>Client Server Federated</p></figcaption></figure>

Figure 3 is the peer to peer architecture. In this there is no central server and each node is independent and failure of one node does not cause any cascade effect.\
\
The three main challenges in any distributed systems are \
1\) Network architecture\
2\) Node data liveliness\
3\) Timing

<figure><img src="https://1091699051-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mhyt4_Y4NOyQJgkBY1e%2F-Mi9vv6-sV96LjoYCeDa%2F-Mi9zX5iEOia514fHVG0%2Fimage.png?alt=media&#x26;token=d843fafa-37ec-43b4-a4f0-daa31220195e" alt=""><figcaption><p>Distributed</p></figcaption></figure>

The below table shows the difficulty levels in each of the architecture for the above mentioned challenges

<figure><img src="https://3601662095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjEiWbDLtVOiXJWwYTIn2%2Fuploads%2FOoSuNUyTfQ78wzYS9198%2Fimage.png?alt=media&#x26;token=f3f37f3b-b8f1-4173-9847-fec5eb86a89e" alt=""><figcaption><p>Complexity</p></figcaption></figure>

{% embed url="<https://youtu.be/Gvmh4lwc4j8>" %}
