We were discussing the P2P network which differs from other forms of distributed computing. For example, it differs from cluster computing, cloud computing, grid computing and connected topologies. In P2P, every node can act both as a client and a server. The nodes act autonomously and are free to join or leave the network. The network may even be the internet. There is no central co-ordination and no central master with slave relationships. The system is self-organizing without need for a central global view from a co-ordinator. If Blockchain becomes a popular storage with which farmers can mine, a P2P network leveraging blockchain storage might become popular as a computing model.
P2P networks can be both structured and unstructured In a structured topology, the P2P overlay is tightly controlled usually with the help of a distributed hash table (DHT) The location information for the data objects is deterministic as the peers are chosen with identifiers corresponding to the data object's unique key. Content therefore goes to specified locations that makes subsequent query easier.
Since the query executes locally at the node, performance is greatly improved as compared to distributing the query over many peers.
Unstructured P2P is composed of peers joining based on some rules and usually without any knowledge of the topology. In this case the query is broadcast and peers that have matching content return the data to the originating peer. This is useful for highly replicated items but not appropriate for rare items. In this approach, peers become readily overloaded and the system does not scale when there is a high rate of aggregate queries.
#codingexercise
Given an unsorted array find the largest gap between any two elements
int GetLargetstGap(List<int> A)
{
return Math.Abs(A.Max() - A.Min());
}
Since the query executes locally at the node, performance is greatly improved as compared to distributing the query over many peers.
Unstructured P2P is composed of peers joining based on some rules and usually without any knowledge of the topology. In this case the query is broadcast and peers that have matching content return the data to the originating peer. This is useful for highly replicated items but not appropriate for rare items. In this approach, peers become readily overloaded and the system does not scale when there is a high rate of aggregate queries.
#codingexercise
Given an unsorted array find the largest gap between any two elements
int GetLargetstGap(List<int> A)
{
return Math.Abs(A.Max() - A.Min());
}
No comments:
Post a Comment