OrbitDB: Peer-to-Peer Databases for the Decentralized Web

This repository profile is provided by osrepos.com, an open source repository discovery platform.

OrbitDB: Peer-to-Peer Databases for the Decentralized Web

Summary

OrbitDB is a serverless, distributed, peer-to-peer database designed for the decentralized web. It leverages IPFS for data storage and Libp2p Pubsub for automatic synchronization, ensuring eventual consistency through Merkle-CRDTs. This makes OrbitDB an excellent choice for p2p, decentralized, blockchain, and local-first web applications, offering various database types like event logs, documents, and key-value stores.

Repository Information

Analyzed by OSRepos on June 22, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

OrbitDB is a serverless, distributed, peer-to-peer database that empowers developers to build applications for the decentralized web. It utilizes IPFS for robust data storage and Libp2p Pubsub to facilitate automatic synchronization across peers. At its core, OrbitDB is an eventually consistent database, employing Merkle-CRDTs to manage conflict-free database writes and merges. This architecture makes it particularly well-suited for p2p and decentralized applications, blockchain solutions, and local-first web experiences.

OrbitDB offers a variety of database types to cater to different data models and use cases:

  • Events: An immutable, append-only log with traversable history, ideal for "latest N" scenarios or message queues.
  • Documents: A document database for storing JSON documents, indexable by a specified key, useful for search indices or version control.
  • Key-Value: A straightforward key-value database.
  • Key-Value Indexed: A key-value database with data indexed in a Level key-value database.

All these databases are built upon OrbitDB's OpLog, an immutable, cryptographically verifiable, operation-based Conflict-Free Replicated Data Structure (CRDT) for distributed systems.

Installation

To get started with OrbitDB, install it and its dependencies using npm:

npm install @orbitdb/core helia

For browser environments, OrbitDB can also be loaded via a <script> tag, making OrbitDB available as a global namespace.

Examples

Here's a quick example demonstrating how to set up an IPFS instance with Libp2p and open an OrbitDB database:

import { createHelia } from 'helia'
import { createOrbitDB } from '@orbitdb/core'
import { gossipsub } from "@chainsafe/libp2p-gossipsub";
import { identify } from "@libp2p/identify";
import { createLibp2p } from 'libp2p'

const Libp2pOptions = {
  services: {
    pubsub: gossipsub({
      // neccessary to run a single peer
      allowPublishToZeroTopicPeers: true
    }),
    identify: identify()
  }
}

;(async function () {
  const libp2p = await createLibp2p({ ...Libp2pOptions })
  const ipfs = await createHelia({libp2p})
  const orbitdb = await createOrbitDB({ ipfs })

  // Create / Open a database. Defaults to db type "events".
  const db = await orbitdb.open("hello")
  
  const address = db.address
  console.log(address)
  // "/orbitdb/zdpuAkstgbTVGHQmMi5TC84auhJ8rL5qoaNEtXo2d5PHXs2To"
  // The above address can be used on another peer to open the same database

  // Listen for updates from peers
  db.events.on("update", async entry => {
    console.log(entry)
    const all = await db.all()
    console.log(all)
  })

  // Add an entry
  const hash = await db.add("world")
  console.log(hash)

  // Query
  for await (const record of db.iterator()) {
    console.log(record)
  }
  
  await db.close()
  await orbitdb.stop()
  await ipfs.stop()
})()

For more detailed examples and configurations, refer to the official @orbitdb/quickstart module.

Why Use OrbitDB?

OrbitDB stands out as a powerful solution for building decentralized applications due to several key features:

  • Decentralized and Serverless: Eliminates the need for a central server, making applications more resilient and censorship-resistant.
  • Peer-to-Peer Synchronization: Automatically syncs data between peers using Libp2p Pubsub, ensuring data availability and consistency across the network.
  • Conflict-Free Data Management: Leverages Merkle-CRDTs to handle concurrent writes and merges without conflicts, simplifying data management in distributed environments.
  • Flexible Data Models: Offers various database types, including event logs, document stores, and key-value stores, to suit diverse application requirements.
  • IPFS Integration: Utilizes IPFS for content-addressed data storage, providing robust and persistent data infrastructure.
  • Cross-Platform Compatibility: Works seamlessly in both browsers and Node.js environments, supporting Linux, OS X, and Windows.

Links

Related repositories

Similar repositories that may be relevant next.

Agent-Memory: Persistent Memory for AI Coding Agents

Agent-Memory: Persistent Memory for AI Coding Agents

August 16, 2026

Agent-Memory provides persistent memory for AI coding agents, ensuring they remember past interactions and learned patterns across sessions. Built on the iii engine, it eliminates the need for re-explaining context, significantly improving agent efficiency and reducing token usage. This solution integrates seamlessly with various agents, offering a robust memory management system.

AIAgent MemoryLLM
Flask-Assets: Seamless Asset Management for Flask Applications

Flask-Assets: Seamless Asset Management for Flask Applications

July 26, 2026

Flask-Assets provides robust integration of the `webassets` library with Flask. It simplifies the process of merging, minifying, and compiling CSS and JavaScript files, significantly enhancing web application performance and streamlining development workflows.

PythonFlaskWeb Development
webassets: Asset Management for Python Web Development

webassets: Asset Management for Python Web Development

July 26, 2026

webassets is a robust library designed for asset management in Python web development. It simplifies the process of merging and compressing JavaScript and CSS files, enhancing application performance. This tool is essential for developers looking to optimize their frontend assets efficiently.

PythonWeb DevelopmentAsset Management
Become-A-Full-Stack-Web-Developer: Free Resources for Web Development

Become-A-Full-Stack-Web-Developer: Free Resources for Web Development

July 19, 2026

The Become-A-Full-Stack-Web-Developer repository is an extensive collection of free resources designed to guide aspiring developers through the entire journey of full-stack web development. It covers a wide array of topics, from foundational languages like HTML, CSS, and JavaScript to advanced frameworks such as React and Node.js, alongside databases, APIs, and career preparation. This resource is invaluable for anyone looking to build a strong skill set in modern web development.

Full StackWeb DevelopmentLearning Resources

Source repository

Open the original repository on GitHub.

22 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️