Skip to content
BENIBIX Learn

Peer-to-Peer (P2P)

Development🏗️ ArchitectureArchitecture Styles

Also known as Peer-to-Peer Network, P2P Network, P2P Architecture

Computers that share work and data with each other. There is no main server.

Think of it like

It is like kids swapping cards in a circle. No teacher hands them out.

Example

Jack downloads a large Linux file with BitTorrent. His computer gets pieces from hundreds of peers and sends pieces on to others at the same time.

Why it matters

There is no single server to pay for or to fail. The more people join, the more there is to share.

Definition

Peer-to-peer is a design where computers share work and data with each other, with no central server. Each computer, called a peer, is both a client and a server. It asks others for data and sends data to them. Adding peers adds more power, so it can grow at low cost. File sharing with BitTorrent works this way.
Client-server, on the left, has a center. Peer-to-peer, on the right, has none.

Common mistake

Trusting every peer. Anyone can join, so each piece of data must be checked, for example with a hash, before it is used.

Key takeaways

  1. 1
    Every node equal. Each is client and server.
  2. 2
    No center. Nothing single to fail.
  3. 3
    Grows with users. More peers, more power.