วันอังคารที่ 19 กรกฎาคม พ.ศ. 2565

decentralized database … private database and public database (English version)

The chia blockchain uses a decentralized database to maintain the blockchain data. Mean any PCs (or node) want to connect to the blockchain, they need to sync up database from mainnet completely before the PC does any activity on the blockchain


With this concept, we can query blockchain information from the local pc. Every updated transaction on the blockchain, the local database will automatically sync up and data inside the local database will always be up-to-date. The query response time from the local database will be faster than query data from a centralized database that is always busy with client traffic and client requests. If the centralized database is out of service, all the clients will not be able to get the data. It is different with a decentralized database. If the PC (or node) is out of service the clients can switch to another node to query the data.    


The chia blockchain is under free license. Meaning we can apply the decentralized database on chia blockchain to the real world use case. Let me bring you to the university library system use case example.


The university has one library per one faculty. If students from Science want to query data from the Engineering library, they need to go to the Engineering library database and search the book that they are interested in. If they are not found, they need to connect to another library and search again. It is a waste of time. With this concept, the different libraries have a chance to order the same book because the data is totally separate.

  

To improve this system, the university can combine all the library data from every faculty into one centralized database server. The students can query data from the server and will know information on the book that they are interested in. By the way, if too many users query data at the same time the server will overload and the result will be slow response to the user. If the centralized database is out of service, all students cannot access the data.


Let the university use the chia blockchain to improve this system. Every faculty will have their own database server. The data from the individual server will always sync up. I will explain how they sync later. The blockchain will have “block height” to specify the latest transaction on the blockchain



From the picture, the current block height is 8,950. Any node that already sync up database until block height 8,950 complete, mean the database is already sync up, they will do nothing and wait the new transaction is created. Any node like Architecture that has current block height only 456. The node need to sync up data with other nodes before do blockchain activity


The individual server will have the plot files that contain many of “solutions”. The plot files will be used when new transaction is created.


Now let make a new transaction. Example the Engineering library has the new 3 books are coming. They will create new transaction for that new 3 books. The transactions is created with "puzzle" and it is stacked into Mempool memory


The blockchain will monitor transaction from Mempool. If it found transaction inside the Mempool, the blockchain will get the transaction from Mempool. Inside the transaction will have "puzzle" then the blockchain will ask "solution" for that "puzzle" from the server who has the plot files. Let say the Science server has the correct solution for this puzzle, the Science server will be updated this transaction into local database. Once local database updated finish, the block height will be increase to 8,951. So any node that has block height lower than 8,951 will be automatic sync up with other node until block height is 8,951




So this is how the chia blockchain decentralized work. The students can connect to any database server to query data. The server loading is sharing.


To looking the "solution" for the transaction "puzzle", we call consensus.

The server that find "solution" from their plot files, we call farming


With this system we have one loophole. Let say we have one bad guy that want to modify the transaction on the blockchain. The bad guy will build new node and connect to the private blockchain. After that the bad guy will create the plot files more than every servers in the blockchain have. Meaning every time blockchain looking for solution, the bad guy have chance to have correct solution from his plot files. Once his plot files has correct solution, the transaction will update at his node. At this point he can modify the transaction before the transaction update into local database. So this system has security issue.


To fix the issue, the server will not require the plot files for farming any more. Every time transaction with "puzzle" is created, the private blockchain will looking the "solution" from the public chia blockchain that more than 200,000 farmers around the world are farming. It is impossible to attack. The security is so strong.


This is the way how private database and public database are connected.


As my understand the World Bank and Climate Warehouse project will use this concept (refer to this link). They will have private database to manage their data and connect to public chia blockchain to do consensus. The final test result will be published on Aug then we will know exactly how they do it.


Thank you for reading. Appreciate for any comment and feedback.



ไม่มีความคิดเห็น:

แสดงความคิดเห็น