Skip to content

Research on P2P Databases

Akhil edited this page Dec 12, 2024 · 3 revisions

Requirements: Looking for a DB which is P2P in nature (like torrent, OrbitDB, DefraDB) but also distributed (like Cassandra, mongo).

Research on P2P Database systems reveals interesting characteristics and limitations of current solutions in the decentralized database space.

OrbitDB Architecture

OrbitDB operates as a serverless, peer-to-peer database built on IPFS infrastructure. Its key characteristics include:

Data Structure

  • Each database instance is a single document or log with fixed write permissions.
  • Uses IPFS for data storage and IPFS PubSub for synchronization.
  • Implements CRDTs (Conflict-Free Replicated Data Types) for conflict resolution.

Key Limitations

  • Eventually consistent model requires full dataset replication.
  • Lacks true distribution capabilities.

DefraDB Architecture

DefraDB represents a newer approach to decentralized databases with enhanced features:

Core Features

  • NoSQL database with flexible storage options.
  • Uses MerkleCRDTs and IPLD for content addressing.
  • Supports GraphQL-compatible query language (DQL).
  • Implements peer-to-peer networking capabilities.

Technical Implementation

  • Multi-write-master architecture.
  • User-centric design with privacy features.
  • Document-level and field-level policy support.
  • Horizontal scaling capabilities.

Key Limitations

  • Query functionality limited to local data.

Comparative Analysis

Feature OrbitDB DefraDB
Distribution Full replication Selective subscription
query search scope local data searches only in local data

Both systems demonstrate the challenges of balancing true peer-to-peer architecture with distributed database capabilities. While OrbitDB focuses on pure P2P functionality, DefraDB attempts to bridge the gap between P2P and distributed systems, though neither fully achieves both objectives simultaneously.

3. Cassandra + libp2p

Cassandra is extremely capable p2p distributed Database (kindly note: here p2p refers to master-master architecture not public p2p like web3, torrent, blockchain)

Approach is to use them as a stack and achieve our goals (WIP)