<p>Querying large data sizes doesn't have to be an issue necessarily, because you can create multiple indices for data access, which speeds up the search process by a large factor.<br>For example think about Google that queries essentially the complete web.</p>
<p>It is expected that the transaction volume grows linearly over time while storage capacity grows exponentially. So the storage problem will likely solve itself over large time frames.<br>
Also see this question:
<a href="https://cardano.stackexchange.com/questions/584/are-there-plans-to-keep-the-blockchain-node-size-small-enough-to-maintain-decent">Are there plans to keep the blockchain/node size small enough to maintain decentralisation?</a></p>

CC BY-SA 4.0
2021-05-26T10:33:11.317Z
The blockchain isn't indexed like a database. To benefit from indices, you'd need to ETL the chain information into a queryable database, right? I'm not sure what you mean otherwise. Even then, you'd essentially be making write operations much slower by making the reads faster. And even then, querying any database with billions/trillions of rows would be insanely slow.
Mr. D
CC BY-SA 4.0
2021-05-26T10:43:42.890Z
@Mr.D That's quite hard to answer. I think you can build indices and query data even if the blockchain itself has no API for that. I also think that indexing does not have to be made in sync with write operations. Theoretically, you can create a new index every day for older entries. Maybe you can even outsource indexing.
But you are right that this wouldn't be an easy task.
Johannes Sirsch
CC BY-SA 4.0
2021-05-26T10:30:00.127Z
2021-05-26T10:36:50.050Z
2021-05-26T10:36:50.050Z
Johannes Sirsch
<p>In the near term, the solution is to keep metadata off chain as much as possible. Proofs/Hashes of the metadata can be used to maintain a reference to the data and guarantee it hasn't changed.</p>
<p>This of course relies on the assumption that said metadata will be available as long as it is needed.</p>
<p>If you look on the IOG GitHub, they have a <a href="https://github.com/input-output-hk/metadata-registry-testnet" rel="nofollow noreferrer">&quot;testnet&quot; repo for the metadata registry</a> and documentation scattered about in the other repos about this. When the metadata registry format is finalised, documentation should be clearly available. Since these registries are just git repositories, it is trivial to spin one up or mirror one. Additionally, since git is already a decentralised protocol, it will fit in quite well with the existing ecosystem.</p>
<p>With this format it seems the goal will be to have multiple community registries and these community registries will likely have multiple independent mirrors (due to the nature of git). This federated system will allow the community to discard unused data as necessary (and said data can be kept by anyone who needs it).</p>
<hr />
<p>Other responses have already addressed parts of the long term goal however I would recommend looking through the <a href="https://iohk.io/en/research/library/" rel="nofollow noreferrer">IOG research catalogue</a>. I believe there are a few papers in there addressing the topic.</p>
<p>Additionally, like other comments have mentioned, side-chains and state channels will allow history to be compressed as much as possible.</p>

CC BY-SA 4.0
2021-05-26T14:27:44.730Z
2021-05-26T14:27:44.730Z
OneDeuxTriSeiGo
<p>The answer to this question is not clear yet, as more research is needed into this problem.</p>
<p>For now, the effort is to prevent the blockchain growing into large sizes with using layer <strike>one</strike> two solutions such as Hydra and possibly with side-chains, where you won't have just one blockchain but many, so the data might be distributed this way.</p>
<p>Shredding will be used too to provide a light-weight view of the blockchain, but many services such as Blockfrost will still have to run full archived nodes to access all the data on the blockchain.</p>

CC BY-SA 4.0
2021-05-26T11:04:28.427Z
Exactly! Most serious applications like real estate history needs to query the entire thing for a full audit. Getting only recent parts of the history via shredding would not be an option in such cases. I suppose a protocol that splits the data across many nodes might work, but you'd still need to put in some redundancy for security measures, so a level of chain duplication will be required even if it's not the full chain being copied everywhere.
Mr. D
CC BY-SA 4.0
2021-05-26T08:25:32.250Z
2021-05-26T12:03:38.330Z
2021-05-26T12:03:38.330Z
Marek Mahut - StakeNuts
<p>Once the ledger size grows beyond the terabyte magnitude, how will Cardano address this issue?
Storing and querying anything that large seems impractical to me.</p>

CC BY-SA 4.0
2021-05-26T10:40:35.253Z
I have no experience on Cardano development, but a couple of years ago I worked on a now defunct cryptocurrency called Unit-e, and we had a proposal that could help mitigating the problem of the ever growing ledger. A sort of cryptographic snapshots: https://github.com/dtr-org/uips/blob/master/UIP-0011.md The key is in [Elliptic Curve Multiset Hashes](https://arxiv.org/abs/1601.06502) .
castarco
<ledger><scaling>
How will Cardano address the ledger growth problem?
# How will Cardano address the ledger growth problem?

(Asked by: username_0 on 2021-05-26)

Once the ledger size grows beyond the terabyte magnitude, how will Cardano address this issue?
Storing and querying anything that large seems impractical to me.

**Tags:** ledger, scaling
> **Comments:**
> **username_1**: I have no experience on Cardano development, but a couple of years ago I worked on a now defunct cryptocurrency called Unit-e, and we had a proposal that could help mitigating the problem of the ever growing ledger. A sort of cryptographic snapshots: https://github.com/dtr-org/uips/blob/master/UIP-0011.md The key is in [Elliptic Curve Multiset Hashes](https://arxiv.org/abs/1601.06502) .  

---

## 3 answers

### Answer by username_4 on 2021-05-26. Score: 6 | Accepted answer

The answer to this question is not clear yet, as more research is needed into this problem.

For now, the effort is to prevent the blockchain growing into large sizes with using layer one two solutions such as Hydra and possibly with side-chains, where you won't have just one blockchain but many, so the data might be distributed this way.

Shredding will be used too to provide a light-weight view of the blockchain, but many services such as Blockfrost will still have to run full archived nodes to access all the data on the blockchain.

> **Comments:**
> **username_0**: Exactly! Most serious applications like real estate history needs to query the entire thing for a full audit. Getting only recent parts of the history via shredding would not be an option in such cases. I suppose a protocol that splits the data across many nodes might work, but you'd still need to put in some redundancy for security measures, so a level of chain duplication will be required even if it's not the full chain being copied everywhere.  

---

### Answer by username_2 on 2021-05-26. Score: 2

Querying large data sizes doesn't have to be an issue necessarily, because you can create multiple indices for data access, which speeds up the search process by a large factor.  
For example think about Google that queries essentially the complete web.

It is expected that the transaction volume grows linearly over time while storage capacity grows exponentially. So the storage problem will likely solve itself over large time frames.  
Also see this question:
[Are there plans to keep the blockchain/node size small enough to maintain decentralisation?](https://cardano.stackexchange.com/questions/584/are-there-plans-to-keep-the-blockchain-node-size-small-enough-to-maintain-decent)

> **Comments:**
> **username_0**: The blockchain isn't indexed like a database. To benefit from indices, you'd need to ETL the chain information into a queryable database, right? I'm not sure what you mean otherwise. Even then, you'd essentially be making write operations much slower by making the reads faster. And even then, querying any database with billions/trillions of rows would be insanely slow.  
> **username_2**: @Mr.D That's quite hard to answer. I think you can build indices and query data even if the blockchain itself has no API for that. I also think that indexing does not have to be made in sync with write operations. Theoretically, you can create a new index every day for older entries. Maybe you can even outsource indexing. But you are right that this wouldn't be an easy task.  

---

### Answer by username_3 on 2021-05-26. Score: 2

In the near term, the solution is to keep metadata off chain as much as possible. Proofs/Hashes of the metadata can be used to maintain a reference to the data and guarantee it hasn't changed.

This of course relies on the assumption that said metadata will be available as long as it is needed.

If you look on the IOG GitHub, they have a ["testnet" repo for the metadata registry](https://github.com/input-output-hk/metadata-registry-testnet) and documentation scattered about in the other repos about this. When the metadata registry format is finalised, documentation should be clearly available. Since these registries are just git repositories, it is trivial to spin one up or mirror one. Additionally, since git is already a decentralised protocol, it will fit in quite well with the existing ecosystem.

With this format it seems the goal will be to have multiple community registries and these community registries will likely have multiple independent mirrors (due to the nature of git). This federated system will allow the community to discard unused data as necessary (and said data can be kept by anyone who needs it).

---

Other responses have already addressed parts of the long term goal however I would recommend looking through the [IOG research catalogue](https://iohk.io/en/research/library/). I believe there are a few papers in there addressing the topic.

Additionally, like other comments have mentioned, side-chains and state channels will allow history to be compressed as much as possible.


---

