Description
In order to scale the current structure to support AI use cases one solution is to use P2P CDN. This document is a draft of the specification for an upcoming upgrade to the Subspace protocol after the Mainnet launch.
Overview of HCDN (Hybrid CDN)
System roles and definition:
- Origin Server: The main server holding the original content, which distributes copies to surrogate servers.
- Surrogate Servers: Servers in a CDN that store and deliver content closer to users to reduce latency.
- Index Server: A server in a P2P network that tracks which peers have specific file chunks for efficient content sharing.
- Peers: User nodes in a P2P network that download and share content with each other.
- Seeds: Peers that have the complete file and are sharing it with other downloaders.
- Downloaders: Peers currently downloading content but who haven’t yet received the entire file.
Data Flow of HCDN
- The origin server begins by splitting the large file into smaller, manageable chunks. During this process, erasure coding (e.g., Reed-Solomon or Luby Transform codes) is applied to the chunks.
- The encoded chunks are then distributed to multiple surrogate servers within the CDN.
- When a user (peer) requests the file, the request is routed to the nearest surrogate server based on network proximity and server load.
- The surrogate server responds to the user’s request by delivering one or more of the encoded file chunks.
- Transition to Peer-to-Peer Sharing
- Formation of Seeds: As peers complete downloading all required chunks, they become seeds. These seeds can now upload chunks to other peers.
- Peer Exchange of Chunks: Downloaders (peers still downloading the file) can obtain different chunks from multiple sources, including both surrogate servers and other peers (seeds).