{"id":107387,"date":"2023-07-30T18:32:08","date_gmt":"2023-07-30T18:32:08","guid":{"rendered":"https:\/\/wp.dash.org\/?p=107387"},"modified":"2023-08-11T04:17:32","modified_gmt":"2023-08-11T04:17:32","slug":"what-is-grovedb","status":"publish","type":"post","link":"https:\/\/wp.dash.org\/blog\/what-is-grovedb\/","title":{"rendered":"What is GroveDB?"},"content":{"rendered":"
GroveDB is the first production-level implementation of a key-value hierarchical authenticated data structure (HADS) designed to supplement the RocksDB database of Dash Platform. Dash Core Group (DCG) created GroveDB since no existing solution provided the desired functionality for the Dash Platform. Overall, GroveDB provides three critical capabilities:<\/span><\/p>\n Dash Platform is on the brink of release and will be Dash\u2019s gateway into Web3. However, why should decentralization remain localized to the platform itself and not the overall experience? Consider this: when a user queries a database, they are essentially asking the host servers to:<\/span><\/p>\n The obvious problem is that you must trust the host to send you back the correct information and act ethically with your data. This is especially relevant for distributed systems like blockchains, where anyone can anonymously host the database.\u00a0<\/span><\/p>\n A solid solution here is to use cryptographic proofs. The data receiver can verify cryptographic proofs sent by the host to ensure the validity of the data. Without cryptographic proof, the receiver can never be assured of the quality and validity of the data received.<\/span><\/p>\n While there are databases that utilize cryptographic proofs, they are inefficient. GroveDB stands out from the competition because of the following:<\/span><\/p>\n <\/p>\n Grove (noun): A small group of trees<\/span><\/i><\/p>\n Unlike a traditional tree architecture, GroveDB uses a hierarchical, authenticated data structure based on Database Outsourcing with Hierarchical Authenticated Data Structures (HADS). The overall graph takes a form where the root hashes of lower-level trees are stored in nodes of higher-level trees, and the root hash of the root tree can be used to prove the state of the entire database. In layman\u2019s terms, instead of using a simple Merkle tree, GroveDB takes on the form of a group (or a grove) of Merkle trees. In the current GroveDB implementation, the top-level \u201cRoot tree\u201d has 5 subtrees \u2013 identities, contract documents, public key hashes to identities, spent asset lock transactions, and pools.<\/span><\/p>\n Before we get into secondary indexes, let’s understand how unique identifiers work in traditional databases. All documents or records that are stored in databases require a unique value or “identifier” to differentiate them from others. The unique identifier can be a column or field in your database \u2013 think of serial numbers in a list.\u00a0<\/span><\/p>\n However, what if the records must be queried based on some other index, as is often true in the real world? Applications often need to query their data based on secondary fields like name, date, city, etc. Databases with secondary indexes allow users to perform complex querying operations using different data fields.<\/span><\/p>\n Databases that provide cryptographic proofs often struggle with handling secondary indexes due to the degree of complexity involved. With GroveDB, the engineers at Dash Core Group have achieved a crucial breakthrough with secondary index management. If you want to know more about how secondary indexing works in GroveDB, <\/span>read this<\/b><\/a>.<\/span><\/p>\n GroveDB provides cryptographic proofs, which ensures the accuracy of the data retrieved. This functionality is invaluable when dealing with sensitive data. As such, GroveDB sees immense utility in industries where trustlessness is crucial.<\/span><\/p>\n As mentioned, enhanced security and advanced query capabilities will give developers a significant advantage when they deploy their dApps on Dash Platform. However, it is not necessary to deploy your applications on Dash Platform to leverage the functionality of GroveDB.<\/span><\/p>\n GroveDB has been designed to be a standalone product that can be integrated with any system using RocksDB. An example of integration using Rust can be seen in\u00a0rs-drive<\/a><\/span>. GroveDB also has bindings for\u00a0Node.js<\/a><\/span>\u00a0to support JavaScript developers.<\/span><\/p>\n Here, we will give you a brief overview of how you can start working with GroveDB. You will find a\u00a0detailed tutorial here<\/a><\/span>.<\/span><\/p>\n The first thing you need to do is clone the\u00a0GroveDB repository<\/a><\/span>. Now, let\u2019s run our tutorials. First up, you will need to build the tutorial code:<\/span><\/p>\n Execute the tutorials using this:<\/span><\/p>\n The\u00a0<tutorial name>\u00a0<\/span>will have the\u00a0tutorials that you can run:<\/span><\/p>\n Tutorial #1: open<\/span><\/p>\n Tutorial #2: insert<\/span><\/p>\n Tutorial #3: delete Tutorial #4: Queries (query-simple and query-complex)<\/span><\/p>\n Tutorial #5: proofs<\/span><\/p>\n As a developer, it is clear to see the advantages of using a database like GroveDB. Currently, it is the only efficient implementation of a cryptographic proof-based database that supports complex queries. We recommend that you go through our\u00a0<\/span>GroveDB tutorials<\/a><\/span>\u00a0to get up to speed on the basics<\/span>.<\/span><\/p>\n\n
Why Was GroveDB Needed?<\/b><\/h2>\n
\n
\n
GroveDB Tree Architecture<\/b><\/h2>\n
Secondary Indexes For Complex Queries<\/b><\/h2>\n
GroveDB Utility<\/span><\/h2>\n
How Do I Get Started With GroveDB?<\/span><\/h2>\n
cd<\/span> grovedb\/tutorials
\ncargo build<\/span><\/code><\/p>\ncargo run<\/span> --bin \u276etutorial name\u276f<\/span><\/code><\/p>\n
\n
\n
\n
\n<\/span><\/p>\n\n
\n
\n
Are You Ready To Use GroveDB?<\/span><\/h2>\n