visit
User:
Users claim data ownership in our network. You could write into, modify, delete, query, share with others, or assign the access right to a third party, all the above data operations are supported in our network. At the same time, these operations need to be paid for because they consume the network’s resources.
dAPP:
dApp mainly assumes the intermediary responsibility of users to query or write personal data, which is an essential foundation for the prosperity of the entire network. Users interact with the internal storage logic of DB3 through the agreed smart contract logic in dApp to complete the data operations as above-mentioned.
Wallet:
Users can pay through the wallet, and the wallet will record the user’s credit balance and complete some necessary signature interactions through the wallet.
Validator:
Validator undertakes two important responsibilities in our network. First, stake and broadcast to ensure node consensus; second, because the nodes owned by Validator can provide resources for data storage and computing, the Validator also undertakes similar node services. Therefore, an additional service fee will be received, similar to the Saas service in web2.
The network will include three parts: storage shard chain, settlement chain, and computing layer. The three work together.
A KV storage engine in the storage shard chain records the interaction process between each user account and the bill generated by the writing or query data process. Each node in the computing layer performs calculations through DVM. The generated calculation results are verified through DVM in the Mempool; the nodes in the settlement chain are responsible for the settlement and summary of the bills output in the storage chain.
// import the db3js
import { DB3, generateMnemonic, generateKey } from "db3";
// config the db3 node
const db3_instance = new DB3("//node1.db3.network");
// subimit your follower data and store in your namespace
const response = await db3_instance.submitMutation({ns: 'my_namespace', gasLimit: 0.3, data: [{follower: lily}]}, private_key);
MySQL Real-time Hot Back-up
To ensure the effect of data read&write performance, the current dApps still maintain a set of centralized databases, such as MySQL, as part of their services. At the same time, to reflect its decentralized permanent storage characteristics, MySQL will synchronize some data to Arweave. But this synchronization is often asynchronous and non-real-time, and it is not easy to recover from Arweave, let alone operations such as indexing and querying. This approach is often only assumed to prevent loss.
Using the DB3 network, you can conveniently carry out a real-time hot backup of the database and restore your data from the network at any time, ensuring the stability of your application services. This way, your infrastructure’s purity of “decentralization” is further improved.
Four nodes service: our above storage service has been running on four test nodes distributed in multiple regions worldwide.
DB3 CLI tool: you can write, modify and query data; meanwhile, the bill is generated. DB3 CDC(Change Data Capture)
CLI tool: you can hot backup the centralized database MySQL database to the DB3 network in real-time, and you can view the backup data in our network and recover it when you need.
// When the backup is successful, a mutation is successfully completed, and a mutation ID and basic information used by your account will be returned
2022-11-21T04:47:29.038953Z INFO db3cdc: no gtid state in db3
WARNING, db3 will generate private key and save it to /home/jackwang/.db3/user.key
restore the key with addr 0x97b478ac2bef8762c2ecc08417f35838c4bf73fc
2022-11-21T04:47:29.040835Z INFO db3cdc: binlog options BinlogOptions { filename: "", position: 4, gtid_set: None, gtid_list: None, starting_strategy: FromStart }
2022-11-21T04:47:29.349037Z INFO db3cdc: mutation id "tWYRruF8dSwvOySMypYCD0pJTVZgquKZu116UddTAps="
2022-11-21T04:47:29.429778Z INFO db3cdc: Your account 0x97b478ac2bef8762c2ecc08417f35838c4bf73fc status: total bills 0.000000 db3, total storage used 0.00 , total mutation 0, credits 10 db3
Blockchain Browser: you can clearly see the block generation process, data query and writing, and corresponding data.
DB3 JS SDK: you can implement web3 native full-stack application development based on the Typescript and write some backend logic.