Coder Social home page Coder Social logo

rahmanunjan / db3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbpunk-labs/db3

0.0 0.0 0.0 10.06 MB

DB3 is a community-driven layer2 decentralized database network.

Home Page: https://community.db3.network/

License: Apache License 2.0

Shell 0.93% Java 5.17% Rust 93.90%

db3's Introduction

db3_logo

GitHub Workflow Status (with event) coverage GitHub commit activity contribution GitHub issues GitHub issues by-label GitHub release (latest SemVer) Twitter Follow Discord

What's DB3 Network?

DB3 is a community-driven layer2 decentralized database network.

  1. Infinite Storage Space

    Scalability is the key to the web3 explosion, db3 will use the following strategies to achieve web3 scale

    • PC can meet the minimum system requirements so everyone can join the db3 network to provide storage space.
    • Using dynamic sharding to achieve scale out. when a storage shard chain has not enough space to store mutation, it will split itself into two subchains.
    • Using cold data archive to recycle storage space. history cold blocks and cold state data will be archived to FileCoin and the storage node will always has storage space to store new data.
  2. Blazed Fast and Provable On-chain Query

    Currently, decentralization means bad performance but db3 is trying to make a big improvement in performance

    • Merkdb is the storage engine of db3 network and it not only has high performance but also the fast-proof generation

    • Geo distribution, the nodes in every storage shard are geo-distributed and the clients can execute querys against the nearest storage node

    • Query session, the first decentralized query protocol to resolve performance and incentive perfectly

  3. Crypto Native Data Ownership

    In the decentralized network, only the private key owners can update their data and they can keep privacy by encrypting their data with the public key

  4. On-chain Programmable

    Dapp developers can develop data processing contracts and deploy them to the db3 network just like developing data backend in web2

  5. Ethereum Guarded Security

    DB3 network is a layer2 network on Ethereum and all the assets are guarded by Ethereum

If you want to know what these features exactly mean? go to the background introduction

Getting Started

Start A Local Testnet

git clone https://github.com/dbpunk-labs/db3.git
cd db3 && bash install_env.sh && cargo build
# start localnet
cd tools &&  sh start_localnet.sh
# open another terminal , enter db3 dir and run db3 shell
./target/debug/db3 shell
>get ns1 k1
>put ns1 k1 v1
submit mutation to mempool done!
>get ns1 k1
k1 -> v1
>account
 total bills  | storage used | mutation | querys | credits
 0.000000 db3 | 38.00        | 2        | 0      | 10 db3

Developers Friendly SDK

// connect to db3 node
const db3_instance = new DB3("http://127.0.0.1:26659");
const doc_store = new DocStore(db3_instance);
const doc_index = {
    keys: [
        {
            name: 'address',
            keyType: DocKeyType.STRING,
        },
        {
            name: 'ts',
            keyType: DocKeyType.NUMBER,
        },
    ],
    ns: 'ns1',
    docName: 'transaction',
};
const transacion = {
    address: '0x11111',
    ts: 9527,
    amount: 10,
};
// insert a document
const result = await doc_store.insertDocs(doc_index, [transacion], _sign, 1);
// query a document
const query = {
    address: '0x11111',
    ts: 9527,
};
const docs = await doc_store.getDocs(doc_index, [query], _sign);

more examples

The Relationship Between Roles

relationship

The Architecture

arch

more technical details

Other Decentralized Database

  • the graph, a decentralized on-chain indexer
  • Locutus, a decentralized key-value database
  • ceramic network, a decentralized data network that brings unlimited data composability to Web3 applications
  • kwil, the first permissionless SQL database for the decentralized internet
  • spaceandtime, a decentralized data Warehouse

License

Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. See CONTRIBUTING.md.

db3's People

Contributors

imotai avatar dependabot[bot] avatar jingchen2222 avatar xiyangjun avatar db3fans avatar muraneth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.