DB3 is a community-driven layer2 decentralized database network.
-
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.
-
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
-
-
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
-
On-chain Programmable
Dapp developers can develop data processing contracts and deploy them to the db3 network just like developing data backend in web2
-
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
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
// connect to db3 node
const db3_instance = new DB3("https://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
more technical details
- 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
Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
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.