development of bitcoin-abe like software I am trying to develop something similar to bitcoin-abe, e.g. import whole blockchain into database.

For database I currently using Redis - I know it will took lots of RAM, but lets suppose that is OK.

Another possibilities could be MySQL, Postgress or even CSV file.

I have bitcoind and I am importing block after block.

For each transaction, I need to look for output of the transactions that "fund" current transaction - I hope you understand what I mean.

I am currently checking with blocks from 2017. Most of blocks have 2000+ transactions. If we assume each transaction have single input, this means I need to look at 2000 more transactions.

At the moment those 2000 lookups are done back to bitcoind, because output database could be csv file.

I can do all this in "lazy" way, but then I will not be able to find if some address is spent.

Is there any faster way to import?

I am using PHP and single block from 2017 is imported for about 1 min.
output is spent (e.g. if appear in &quot;vin&quot; to some other transaction), I store an indicator.
Now single block is processed for 1-2 sec.
Implication of this is,
if you want to check address balance, you will need to check each &quot;input&quot; and to compile list of unspent inputs.
Still unsure if this is best way to go.
Update 1
I finally upload the software in github here:
https://github.com/nmmmnu/BlockchainWalker
Update 2
Here are how keys looks like if we want to find the balance for address &quot;1EoMoJK3FJPHg4EwrP31zPVu4iLqmCtQ6&quot;:
127.0.0.1:2000&gt; HGETALL a:1EoMoJK3FJPHg4EwrP31zPVu4iLqmCtQ6
 1) &quot;a:1EoMoJK3FJPHg4EwrP31zPVu4iLqmCtQ6:28c76c9d89f23c1b1f5435d8f4bb5cc66e6cb9d0798f1f0f4293faaac88fb7d0.0&quot;
 2) &quot;0.01270199&quot;

This is funding transaction:

28c76c9d89f23c1b1f5435d8f4bb5cc66e6cb9d0798f1f0f4293faaac88fb7d0, output 0

This is value:

0.01270199

Then we need to check if this is spent, so we check each input as follows:
127.0.0.1:2000&gt; get t:28c76c9d89f23c1b1f5435d8f4bb5cc66e6cb9d0798f1f0f4293faaac88fb7d0.0:s
&quot;055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8&quot;

Transaction 055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8, is the transaction where this output is spent.
As each output is spent this means the address 1EoMoJK3FJPHg4EwrP31zPVu4iLqmCtQ6 have balance of zero.

In case we want to check / list a transaction &quot;055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8&quot;, we can do:
127.0.0.1:2000&gt; HGETALL t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8
 1) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.-:i:28c76c9d89f23c1b1f5435d8f4bb5cc66e6cb9d0798f1f0f4293faaac88fb7d0.0&quot;
 2) &quot;1&quot;
 3) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.-:i:39edb8741b701b6da2dbc4e02290e8e78cba244bdbad96da203e41ee2704c525.0&quot;
 4) &quot;1&quot;
 5) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.0:o&quot;
 6) &quot;1Kj76Sxe8c3UK85RAQwwdqScAxaBwAY2eb:0.00500000&quot;
 7) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.0:s&quot;
 8) &quot;49f8bd582439a3b2351f92e0fdb5fcb1032acd42e3ab469c16d805627889ce14&quot;
 9) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.1:o&quot;
10) &quot;14yAJga4ZkULbaMz4LUW5vj8GhQYyzCPoW:0.01118727&quot;
11) &quot;t:055bd8148143c5b05bc2808ccafe54be43b292381449d41cc23462d02d3f85d8.1:s&quot;
12) &quot;edf55ace1396229c7a91a4b21cd63293c631ae2ddcc5987402b04ed540b9e5d8&quot;

Those &quot;t:xxxxx.-:i:xxxx&quot; are inputs.
Those &quot;t:xxxxx.N:o&quot; are outputs
Those &quot;t:xxxxx.N:s&quot; are indicators, if output is spent or not.

Please note this is not Redis, it is database I developing that have Redis interface. You can check it here:
https://github.com/nmmmnu/HM4