In a peer-to-peer (P2P) architecture peers are both clients and servers.
P2P architectures are more distributed and decentralized
than client-server architectures.
In the following example each peer maintains some fragment
of a file. Peer1 wants to assemble the file, so requests fragments from peers 2
and 3. But now peer2 can request fragment2 from peer1:
This is a simplified version of the Bit Torrent file sharing protocol. It replaces the idea of a
centralized file server by distributing the responsibility of maintaining and
serving fragments of files to a swarm of peers. Napster is an early application
of this protocol.
Bitcoin uses a P2P
architecture. Peers are called miners. Each miner maintains a copy of a ledger
called a blockchain. The ledger consists of records of bitcoin transactions.
Miners race to add blocks of transactions to the blockchain. The winner is rewarded
with bitcoins.
Tor is a browser
for the dark web. It sends requests through a network of relays that make it
difficult to trace.
The agents of multi-agent
architectures are peers.
Web 2.0 was
originally conceived as an agent-based architecture in which agents were played
by web services.