in distributed data storage, a p-grid is a self-organizing structured peer-to-peer system, which can accommodate arbitrary key distributions (and hence support lexicographic key ordering and range queries), still providing storage load-balancing and efficient search by using randomized routing. == salient features == * good storage load-balancing despite arbitrary load-distribution over the key-space. * range queries can be naturally supported and efficiently processed on p-grid because p-grid abstracts a trie-structure, and supports (rather) arbitrary distribution of keys, as observed in realistic scenarios. * a self-referential directory is realized to provide peer identity persistence over multiple sessions. * a gossip primitive based update mechanism for keeping replicated content up-to-date. * easy merger of multiple p-grids, and hence decentralized bootstrapping of the p-grid network. * query-adaptive caching is easy to realize on p-grid to provide query load-balancing where peers have restricted capacity. == overview == 400px|thumb|for the sake of simplicity, this figure does not show replication. p-grid abstracts a trie and resolves queries based on prefix matching. the actual topology has no hierarchy. queries are resolved by matching prefixes. this also determines the choice of routing table entries. each peer, for each level of the trie, maintains autonomously routing entries chosen randomly from the complementary sub-trees. in fact, multiple entries are maintained for each level at each peer to provide fault-tolerance (as well as potentially for query-load management). for diverse reasons including fault-tolerance and load-balancing, multiple peers are responsible for each leaf node in the p-grid tree. these are called replicas. the replica peers maintain an independent replica sub-network and uses gossip based communication to keep the replica group up-to-date. the redundancy in both the replication of key-space partitions as well as the routing network together is called structural replication. the figure below shows how a query is resolved by forwarding it based on prefix matching. == range queries in p-grid == p-grid partitions the key-space in a granularity adaptive to the load at that part of the key-space. consequently, its possible to realize a p-grid overlay network where each peer has similar storage load even for non-uniform load distributions. this network probably provides as efficient search of keys as traditional distributed hash tables (dhts) do. note that in contrast to p-grid, dhts work efficiently only for uniform load-distributions. hence we can use a lexicographic order preserving fu
Distributed_data_storage File_sharing Peer-to-peer_file_sharing