Can Blockchain Be Queried as a Database?

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Database
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
Messages
7,819
Reaction score
13,151
Hi All,
Just curious: If blockchain is a database.
Can it be queried? I don't know how key-value systems are queried.
How are blocks added?
I guess if it is a DB, it is not modifiable
 
on Phys.org
Caveat: I don't know anything about blockchains, Bitcoin, or other crypto-currencies. I'll respond to the question you asked, which might not be what you're really asking.
WWGD said:
I don't know how key-value systems are queried.
A dictionary (in Python parlance) or map (in C++ parlance) is a data structure consisting of key-value pairs. You can access (for read or write) a value by using its key, similar to the way you access an element of an array by using its index in the array. One difference is that for an array, the indexes have to be integral values; for a dictionary/map, the keys can be strings or numbers, or other types.
 
  • Like
Likes   Reactions: WWGD
WWGD said:
Hi All,
Just curious: If blockchain is a database.

I am not a blockchain user but I know some things about it.
Blockchain technology creates a distributed database and the difference between it and a traditional database is that it is not centralized as the latter i.e. it is not based on the classical client - server model, where the client can among other things - where "things" means the CRUD operations, change entries that are stored in some server on the net i.e on some centralized resource. In blockchain technology each participant maintains, calculates and updates new entries into the database in the form of records. Blockchain is a combination and orchestration of three technologies: Internet (specifically P2P network form), cryptography (private key) and a protocol.
As it is decentralized it is appropriate for some specific functions but not for all. Centralized databases are appropriate for other.

One notable thing about blockchains is that they can provide real time information but they can also hold their own history and expand. They are not as fast as a centralized traditional database and this is mostly due to the fact that are based on distributed networks that do not share processing power so each one must process and then compare to the rest of the whole network in order some "consensus" of what has happened to be reached. Also, hiding information using some form of cryptography poses a serious computational burden for the machines on the network.
 
  • Like
Likes   Reactions: FactChecker and WWGD
WWGD said:
Hi All,
Just curious: If blockchain is a database.
Can it be queried? I don't know how key-value systems are queried.
How are blocks added?
I guess if it is a DB, it is not modifiable

There are a variety of blockchain technologies out there. Very generally:

A blockchain is a database that records transactions. You can query a blockchain but you cannot modify blocks other than the current block. Validated transactions are written to the current block and when the current block reaches a set size, a new block becomes the current block.
 
  • Like
Likes   Reactions: WWGD