# Query Processing in Blockchain Systems: Current State and Future Challenges
## 2 Fundamentals of Blockchain Technology
Depending on the chosen consensus mechanism, it may take some time until a data record is actually included in the blockchain, whereas there is no such delay in traditional database systems [25; 26]. For all these conceptual and architectural reasons, query performance is also much higher for traditional databases in terms of throughput, the key efficiency metric for data stores [27; 28]. Table 1 summarizes the main differences between traditional databases and blockchains that have an impact on their query capabilities. Unlike in traditional database systems, data do not necessarily have to be stored in a blockchain. To this end, there are basically two approaches [29]. In the first approach called \"on-chain\", the actual data are stored within a blockchain. In the second approach, called \"off-chain\", the actual data are still stored in a traditional database system, but the information required to verify the actual data is stored on the blockchain. However, the verification overhead is significantly greater than with the first approach. Hybrid approaches are also possible, e.g., data are stored partly in a blockchain and partly in a traditional database system with their verification information on a blockchain. Overall, the public verification of the data in a blockchain is a fundamental characteristic of blockchain technology. This transparency enables every node to check the integrity of the data in a blockchain, thus creating trust in the stored data. The focus on blockchain technology is on security, unlike traditional database systems, which focus on performance (i.e., transaction throughput). Additionally, blockchain technology provides protection \begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt} p{142.3 pt}} \hline \hline
**Property** & **Traditional Database** & **Blockchain** \\ \hline _Architecture_ & The traditional database model assumes that there is a central trustable administrator for the entire database. On that account, the database is hosted on a server and subordinated clients have to send their queries to this server. & The blockchain model assumes a network of equal nodes. Each node hosts its own instance of the entire blockchain. Although each node can execute queries independently, the network must agree on which is the valid state of the blockchain. \\ \hline _Replication_ & Even though traditional databases can use replication techniques internally, e.g., to prevent failure of physical storage media, externally there is only one database instance. & In a blockchain, there is full replication of all data on all nodes, i.e., the failure of a single node does not affect the availability of the data. \\ \hline _Validation_ & Traditional databases only ensure that if the database was in a consistent state before a write operation, it is also consistent after that operation. In addition, it is ensured that no side effects can occur when several users operate on the database. & Two types of validation take place in blockchains: (a) The nodes in the network agree in a consensus feature on what the valid state of the blockchain is, i.e., what data are part of the blockchain. (b) Users can verify the integrity of the data due to the tamper-resistance. \\ \hline _Structuring_ & Traditional databases organize data into tables, each with its own schema. & Blockchains organize data into blocks that have no semantic meaning. \\ \hline _Operations_ & Traditional databases provide full CRUD support. & Blockchains support only read and write (add new data) operations. \\ \hline _History_ & Traditional databases contain the latest snapshot of the data only. & Blockchains provide the complete data history. \\ \hline _Insertion_ & Inserted data are immediately available in a traditional database. & Due to the consensus mechanism, data are inserted with a time delay. \\ \hline _Performance_ & Traditional databases are geared towards a high data throughput. & The data throughput is significantly low due to the consensus. \\ \hline \hline \end{tabular}
\end{table}