# Max Payload Size

**URL:** <https://forum.canton.network/t/max-payload-size/564>\
**Category:** App Development\
**Tags:** daml\
**Created:** [May 29, 2020, 3:37pm UTC](https://forum.canton.network/t/max-payload-size/564 "2020-05-29T15:37:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Safar](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jean_safar/32/186_2.png) [@Jean\_Safar](https://forum.canton.network/u/Jean_Safar)\
**Post date:** [May 29, 2020, 3:37pm UTC](https://forum.canton.network/t/max-payload-size/564/1 "2020-05-29T15:37:00Z")

</div>

Hi,

Apologies if asked before (I could not find it) … is there a maximum size of data that can be placed in a template?

thanks

---

<div class="post-metadata">

**Author:** ![gerolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gerolf/32/358_2.png) [@gerolf](https://forum.canton.network/u/gerolf)\
**Post date:** [May 29, 2020, 5:15pm UTC](https://forum.canton.network/t/max-payload-size/564/2 "2020-05-29T17:15:30Z")

</div>

Hi @Jean_Safar,

Welcome to the forum 👋

There is no limitation as per the DAML ledger model.

There are other technical limitations though. The RPC protocol used for the ledger api (gRPC) specifies a maximum message size that defaults to ~4MB. So both client and ledger need to be configured to accept messages larger than that. (See for example [this post](https://discuss.daml.com/t/how-do-i-increase-the-grpc-message-size-limit-in-sandbox/470/2)).  
Additionally one has to consider that DAML contract values need to be serialized, deserialized, sent to the committer for validation, translated for the ledger api, etc, so large values definitely have an impact on performance in one way or another.

I’d be interested in what context you are using DAML? Only if you can share that with us, of course?

---

<div class="post-metadata">

**Author:** ![Jean\_Safar](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jean_safar/32/186_2.png) [@Jean\_Safar](https://forum.canton.network/u/Jean_Safar)\
**Post date:** [June 3, 2020, 6:18am UTC](https://forum.canton.network/t/max-payload-size/564/3 "2020-06-03T06:18:09Z")

</div>

Thanks a lot @gerolf,

All my data is indeed serializable … Not being able to store it inside a template complexifies the architecture. I need to Hash the data and store it separately and in essence create an indirection when trying to access the data, which eventually will impact performance.

Best regards-

---

<div class="post-metadata">

**Author:** ![gerolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gerolf/32/358_2.png) [@gerolf](https://forum.canton.network/u/gerolf)\
**Post date:** [June 3, 2020, 7:48am UTC](https://forum.canton.network/t/max-payload-size/564/4 "2020-06-03T07:48:03Z")

</div>

Bernhard just posted a [nice post](https://discuss.daml.com/t/on-attachments-what-you-should-and-shouldnt-store-on-a-ledger/579) that might be interesting to you.

---

<div class="post-metadata">

**Author:** ![Jean\_Safar](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jean_safar/32/186_2.png) [@Jean\_Safar](https://forum.canton.network/u/Jean_Safar)\
**Post date:** [June 4, 2020, 9:15am UTC](https://forum.canton.network/t/max-payload-size/564/5 "2020-06-04T09:15:58Z")

</div>

Thanks - I did see (word missing :-() this post indeed-

---

<div class="post-metadata">

**Author:** ![andreolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/andreolf/32/491_2.png) [@andreolf](https://forum.canton.network/u/andreolf)\
**Post date:** [June 4, 2020, 11:35am UTC](https://forum.canton.network/t/max-payload-size/564/6 "2020-06-04T11:35:17Z")

</div>

great post indeed @Jean_Safar
