decentralized,distributed,peer-to-peer database.

P2PDB

standard-readme compliant

中文 | English

简介 P2PDB(p2p数据库),是一个去中心化、分布式、点对点数据库、P2PDB使用IPFS为其数据存储和IPFS Pubsub自动与对等方同步数据。P2PDB期望打造一个去中心化的分布式数据库,使P2PDB 成为去中心化应用程序 (dApps)、区块链应用程序和离线Web应用程序的绝佳选择。

P2PDB包含以下功能:

  1. count 一个分布式计数器,用于验证项目可行性,使用CRDT协议,实现最终一致性(开发中)

  2. kv 一个key=>value 的键值数据库,使用CRDT协议,实现最终一致性(已完成)

  3. doc 一个专为配置文档、注册中心设计的文档数据库,使用CRDT协议,实现最终一致性(已有明确计划,未开发)

  4. sql 一个基于sqlite 实现较强一致性关系型数据库,自建partition协议(探索中,未有明确计划)

  5. raft 基于raft 协议跟IPFS协议结合的强一致性数据库(探索中,未有明确计划)

  6. pubsub 基于IPFS Pubsub实现 消息订阅、广播推送

内容列表

背景

随着互联网的发展,中心化互联网逐渐往多中心化、分布式化演变,目前尚未有一种基础设施可以实现低延迟、去中心化的数据交换网络,ipfs的出现弥补了这一场景的空白,filecoin很好的解决了边缘文件存储问题,但是尚未有一种轻量级的数据库可以解决边缘数据存储,支撑dapp、区块链发展、及物联网终端网络不佳下的数据存储,这也是P2PDB数据库设计的初衷。

—— 跟ipfs的关系

ipfs协议 用于构建分布式低延迟的消息传输网络,而P2PDB 项目是基于ipfs协议实现.。

—— 跟filecoin的区别

P2PDB类似filecoin实现文件交换网络一样,目的是为了实现全球去中心化的数据交换网络。不同的是, P2PDB只接受一段数据流的存储而不是文件,相对filecoin来说,P2PDB更轻量级,数据交换速度更快(数据体积更小),P2PDB可以理解为是一款边缘存储的轻量级关系型数据库,当然P2PDB也支持非关系性数据库中key=>value 键值对,以及类似mongdb的文档型数据存储格式。

目标

这个数据库的目标是:

  1. 一个Dapp应用数据存储方案
  2. 一个分布式数据库解决方案
  3. 一个分布式缓存系统解决方案
  4. 一个边缘数据存储解决方案

使用场景

  • 1、文章阅读数、投票数、点赞数
  • 2、文章评论
  • 3、微服务的服务注册、发现
  • 4、配置中心
  • 5、分布式缓存
  • 6、多人实时协作
  • 7、更多.........

架构

目录分层设计

interface 接口层
----api
--------count
--------kv
--------doc
--------sql
--------raft
-----http 对外暴露的http api 接口
-----rpc 对外暴露的rpc api接口
-----cli 命令行执行工具
domain 领域层, 核心逻辑
Infrastructure	基础设施层
----ipfs
--------ipfs-log
----Raft
----sqlite
----Util  公共工具,如日志
--------log

##安装

这个项目使用 golang 请确保你本地安装了它。

初始化项目

go mod tidy

编译kv数据库

go build ./interface/cli/kv/kv.go

使用

./kv

使用说明

一、 P2PDB存储的数据都是通过公钥加密,只有掌握私钥的客户端才可以解密查看真实数据

理解CRDT 最终一致性协议

示例

Commands:

> list               -> list items in the store
> get <key>          -> get value for a key
> put <key> <value>  -> store value on a key
> exit               -> quit

想了解我们建议的规范是如何被应用的,请参考 example-readmes

本数据库使用到的部分仓库

维护者

@Rock

如何贡献

非常欢迎你的加入!提一个 Issue 或者提交一个 Pull Request。

标准 Readme 遵循 Contributor Covenant 行为规范。

贡献者

使用许可

Apache License, Version 2.0 © Rock Li

Similar Resources

Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures.

Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures. capabilities which owl provides include Process approval、sql Audit、sql execute and execute as crontab、data backup and recover .

Nov 9, 2022

This is a simple graph database in SQLite, inspired by "SQLite as a document database".

About This is a simple graph database in SQLite, inspired by "SQLite as a document database". Structure The schema consists of just two structures: No

Jan 3, 2023

Hard Disk Database based on a former database

Hard Disk Database based on a former database

Nov 1, 2021

Simple key value database that use json files to store the database

KValDB Simple key value database that use json files to store the database, the key and the respective value. This simple database have two gRPC metho

Nov 13, 2021

Beerus-DB: a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic operations

Beerus-DB · Beerus-DB is a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic

Oct 29, 2022

Eventually consistent distributed in-memory cache Go library

bcache A Go Library to create distributed in-memory cache inside your app. Features LRU cache with configurable maximum keys Eventual Consistency sync

Dec 2, 2022

A distributed key-value store. On Disk. Able to grow or shrink without service interruption.

Vasto A distributed high-performance key-value store. On Disk. Eventual consistent. HA. Able to grow or shrink without service interruption. Vasto sca

Jan 6, 2023

A distributed Configuration Center server that manages config in a container. The container is composed of fields (abstract layer includes: KV, LIST, DICT type). The Field contains basic datatypes (int, float, bool, string, list, dict).

A distributed Configuration Center server that manages config in a container. The container is composed of fields (abstract layer includes: KV, LIST, DICT type). The Field contains basic datatypes (int, float, bool, string, list, dict).

cassem config assembler from key-value pairs' container which include basic datatypes, such as int, string, float, bool, list, dict Features HTTP Rest

Nov 1, 2022

A distributed MySQL binlog storage system built on Raft

A distributed MySQL binlog storage system built on Raft

What is kingbus? 中文 Kingbus is a distributed MySQL binlog store based on raft. Kingbus can act as a slave to the real master and as a master to the sl

Dec 31, 2022
Related tags
A decentralized, trusted, high performance, SQL database with blockchain features
A decentralized, trusted, high performance, SQL database with blockchain features

中文简介 CovenantSQL(CQL) is a Byzantine Fault Tolerant relational database built on SQLite: ServerLess: Free, High Availabile, Auto Sync Database Service

Jan 3, 2023
Distributed reliable key-value store for the most critical data of a distributed system

etcd Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order

Jan 9, 2023
CockroachDB - the open source, cloud-native distributed SQL database.
CockroachDB - the open source, cloud-native distributed SQL database.

CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters. What is CockroachDB? Docs Quickstart C

Jan 2, 2023
The lightweight, distributed relational database built on SQLite.
The lightweight, distributed relational database built on SQLite.

rqlite is a lightweight, distributed relational database, which uses SQLite as its storage engine. Forming a cluster is very straightforward, it grace

Jan 5, 2023
TiDB is an open source distributed HTAP database compatible with the MySQL protocol
TiDB is an open source distributed HTAP database compatible with the MySQL protocol

Slack Channel Twitter: @PingCAP Reddit Mailing list: lists.tidb.io For support, please contact PingCAP What is TiDB? TiDB ("Ti" stands for Titanium) i

Jan 9, 2023
LBADD: An experimental, distributed SQL database
LBADD: An experimental, distributed SQL database

LBADD Let's build a distributed database. LBADD is an experimental distributed SQL database, written in Go. The goal of this project is to build a dat

Nov 29, 2022
A course to build the SQL layer of a distributed database.

TinySQL TinySQL is a course designed to teach you how to implement a distributed relational database in Go. TinySQL is also the name of the simplifed

Jan 8, 2023
TalariaDB is a distributed, highly available, and low latency time-series database for Presto
TalariaDB is a distributed, highly available, and low latency time-series database for Presto

TalariaDB is a distributed, highly available, and low latency time-series database that stores real-time data. It's built on top of Badger DB.

Nov 16, 2022
Redwood is a highly-configurable, distributed, realtime database that manages a state tree shared among many peers

Redwood is a highly-configurable, distributed, realtime database that manages a state tree shared among many peers. Imagine something like a Redux store, but distributed across all users of an application, that offers offline editing and is resilient to poor connectivity.

Jan 8, 2023
Couchbase - distributed NoSQL cloud database

couchbase Couchbase is distributed NoSQL cloud database. create Scope CREATE SCO

Feb 16, 2022