# What's the maximum of mutations I can do within a DQL mutation? Is there even a maximum?

**URL:** <https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030>\
**Category:** Dgraph\
**Tags:** kind:question\
**Created:** [November 12, 2021, 12:22am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030 "2021-11-12T00:22:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juri](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/juri/32/8872_2.png) [@Juri](https://discuss.dgraph.io/u/Juri)\
**Post date:** [November 12, 2021, 12:22am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030/1 "2021-11-12T00:22:23Z")

</div>

Hi, if I want to mutate 1000 fields of 1000 nodes, can I just do that with a DQL mutation? or is that not possible? or is that possible, but I might run into troubles?

What’s actually the maximum? Can I mutate 100000 fields with a single mutation?

thanks a lot

BTW: is that also possible with graphql? can I do these many mutations also with graphql?

---

<div class="post-metadata">

**Author:** ![BenW](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/benw/32/7532_2.png) [@BenW](https://discuss.dgraph.io/u/BenW)\
**Post date:** [November 12, 2021, 1:23am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030/2 "2021-11-12T01:23:21Z")

</div>

This is an interesting question. I want to import my RoamResearch graph into a Dgraph instance, a DQL transaction seems to be the best approach. Technically I could programmatically build the set JSON object to pass to the DQL mutation, but I’m wondering whether I should insert the entire graph in one giant mutation or batch it.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [November 12, 2021, 1:37am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030/3 "2021-11-12T01:37:26Z")

</div>

There is no maximum, it will depend on the amount of available resources and the configuration used to build the cluster - and the approach of sending these data. What we recommend is having transactions with an average of 5k objects. But if you have more resources, you can extrapolate.

> [@Juri](#):
>
> Hi, if I want to mutate 1000 fields of 1000 nodes, can I just do that with a DQL mutation?

Yes.

> [@Juri](#):
>
> or is that possible, but I might run into troubles?

Only if you push hard a very low resources Cluster.

> [@Juri](#):
>
> What’s actually the maximum? Can I mutate 100000 fields with a single mutation?

In theory yes, Dgraph is a horizontally scalable system.

> [@Juri](#):
>
> is that also possible with graphql?

Nope, GraphQL is a very typed lang. You could mix DQL with GQL. Maybe the upsert transaction(not sure if we already have it in GQL) could be possible to mutate several objects. Not sure.

> [@Juri](#):
>
> can I do these many mutations also with graphql?

In theory, you can do whatever you could with DQL, but what limits you is the GraphQL Spec.

> [@BenW](#):
>
> a DQL transaction seems to be the best approach.

Use the Liveloader. It is made to do a controlled load.

> [@BenW](#):
>
> but I’m wondering whether I should insert the entire graph in one giant mutation or batch it.

I don’t recommend huge batches, split into small batches and control the shot. You can use a normal client, but you have to create a balancing strategy. Never shot against a single Alpha, always shoot even between them. That’s my personal recommendation, so you can take out the best of the best of your cluster.

---

<div class="post-metadata">

**Author:** ![BenW](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/benw/32/7532_2.png) [@BenW](https://discuss.dgraph.io/u/BenW)\
**Post date:** [November 12, 2021, 1:58am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030/4 "2021-11-12T01:58:34Z")

</div>

This is great thanks. How would I go about figuring out what the max load is for my setup, beyond just seeing whether it times out or not?

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [November 12, 2021, 2:41am UTC](https://discuss.dgraph.io/t/whats-the-maximum-of-mutations-i-can-do-within-a-dql-mutation-is-there-even-a-maximum/16030/5 "2021-11-12T02:41:15Z")

</div>

It depends. You can pick what bothers you. e.g. Latency increase, Alphas going OOM.
