0

If I had to query my blockchain database built on the Ethereum network, how long would it between the request and response? Let's assume that the type of information is not media and only normal data. Would it be as fast as a conventional centralized database?

Arjun Ram
  • 369
  • 2
  • 18
  • 3
    This question is a little like "How long is a string?" – user94559 May 25 '18 at 01:58
  • I've changed the question slightly. – Arjun Ram May 25 '18 at 10:05
  • To just read data you don't need to talk to any server (as I understand it). You just read from your local node. Blockchain is the worlds slowest and least scalable database, though. – usr May 25 '18 at 10:44
  • If it's just about reading from the local node as opposed to sending a request and receiving a response from a server, why is the blockchain slower? – Arjun Ram May 25 '18 at 11:31
  • You can write a custom node and index it any way you like. So you're right, that could be as fast as you want it. – usr May 25 '18 at 12:55

1 Answers1

3

Reading data that has already been written and confirmed is fast. If you are running a full node you have access to all the blockchain data. How fast you can read it depends on your machine and where the data is stored (SSD, etc.). The data is stored in a leveDB database. "LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values." https://github.com/google/leveldb

Writing data is very slow, so if you are expecting to create a transaction and then have other clients read it immediately thereafter you will be disappointed. The answer in this case is 'it depends' and can range from seconds on a local testnet to minutes or hours depending on a number of factors.

Doug King
  • 231
  • 2
  • 5