<p>There is no code for that, and it would be either very slow or nearly useless.</p>

<p>Bitcoin Core assumes it has exclusive access to the -database, and caches data very aggresively. It may take hours before actual data from the chain is on disk.</p>

<p>The data structures are very compact and specifically designed for efficient use in Bitcoin Core. This means only unspent transaction outputs and block/transaction disk location are written to the database, in a custom byte-level format. You'd have to write your own parsers for these. In the 0.12 release most of this data will be scrambled by default even, to thwart overly aggressive virus scanners that detect virus patterns inside the database.</p>

<p>In short, that's not what the database is intended for. If you want something to index the blockchain or query the UTXO set, there exist other projects that build databases specifically designed for that. </p>

CC BY-SA 3.0
2015-11-15T14:42:55.637Z
Thanks, what do you recommend to use to query DB for op_return data if I don't know in which block or tx it has been stored?
Igor Barinov
CC BY-SA 3.0
2015-11-15T17:50:05.583Z
@IgorBarinov you need to parse the blockchain and check every transaction for op_return output in this block, or you can use http://coinsecrets.org/ API or BlockCypher asset API http://dev.blockcypher.com/#asset-api
Farghaly
CC BY-SA 3.0
2015-11-15T18:05:16.313Z
@Farghaly thx. I found this one repo on github https://github.com/RCasatta/op_return with some analytics on op_return. check it out http://opreturn-976.appspot.com/
Igor Barinov
CC BY-SA 3.0
2015-11-15T18:21:39.013Z
@IgorBarinov it uses Google visualization API alongside with coinsecrets and Blockr API to show stats of op_return usage
Farghaly
CC BY-SA 3.0
2015-11-15T14:01:03.863Z
2015-11-15T14:01:03.863Z
Pieter Wuille
<p>Is it possible to use db other than leveldb for bitcoin core? I'd like to make queries on running node and make views with decoded data </p>

<bitcoin-core><leveldb>
mysql instead of leveldb for bitcoin core
Igor Barinov
# mysql instead of leveldb for bitcoin core

(Asked by: username_0 on 2015-11-15)

Is it possible to use db other than leveldb for bitcoin core? I'd like to make queries on running node and make views with decoded data

**Tags:** bitcoin-core, leveldb


---

## 1 answers

### Answer by username_1 on 2015-11-15. Score: 9 | Accepted answer

There is no code for that, and it would be either very slow or nearly useless.

Bitcoin Core assumes it has exclusive access to the -database, and caches data very aggresively. It may take hours before actual data from the chain is on disk.

The data structures are very compact and specifically designed for efficient use in Bitcoin Core. This means only unspent transaction outputs and block/transaction disk location are written to the database, in a custom byte-level format. You'd have to write your own parsers for these. In the 0.12 release most of this data will be scrambled by default even, to thwart overly aggressive virus scanners that detect virus patterns inside the database.

In short, that's not what the database is intended for. If you want something to index the blockchain or query the UTXO set, there exist other projects that build databases specifically designed for that.

> **Comments:**
> **username_0**: Thanks, what do you recommend to use to query DB for op_return data if I don't know in which block or tx it has been stored?  
> **username_2**: @username_0 you need to parse the blockchain and check every transaction for op_return output in this block, or you can use http://coinsecrets.org/ API or BlockCypher asset API http://dev.blockcypher.com/#asset-api  
> **username_0**: @username_2 thx. I found this one repo on github https://github.com/RCasatta/op_return with some analytics on op_return. check it out http://opreturn-976.appspot.com/  
> **username_2**: @username_0 it uses Google visualization API alongside with coinsecrets and Blockr API to show stats of op_return usage  

---

