# How to update a large amount of data in dgraph every day

**URL:** <https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491>\
**Category:** Dgraph\
**Tags:** mutation\
**Created:** [November 22, 2019, 3:09am UTC](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491 "2019-11-22T03:09:44Z")\
**Posts on this page:** 4\
**Page:** 2

<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:** [July 31, 2020, 2:04pm UTC](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491/21 "2020-07-31T14:04:25Z")

</div>

> [@bshyamkumar](#):
>
> Imagine that we are bulk importing from ES daily.

What do you mean by ES?

> [@bshyamkumar](#):
>
> In order to not create duplicates of mutated entities, we must set uid

You can also use Upsert Block.

> [@bshyamkumar](#):
>
> so one suggestion was to use a hash of the id in ES.

Yes, and use it in an Upsert Block.

> [@bshyamkumar](#):
>
> Another option is to propagate the dgraph generated id back to ES which does not scale very well.

I didn’t get it. How does this propagation works?

> [@bshyamkumar](#):
>
> What is your solution for this scenario? ES is the ground truth for some of the entities in the graph and we can’t alter that.

I’m not able to understand this scenario.

---

<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:** [July 31, 2020, 2:07pm UTC](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491/22 "2020-07-31T14:07:06Z")

</div>

> [@seanlaff](#):
>
> The dgraph zero leases out blocks of uids at a time

One can lease as many uid needs via `/assign?what=uids&num=10000000000000000`. If you use the tips given here, it will work normally if you do this.

see [Self-managed cluster - Deploy](https://dgraph.io/docs/deploy/#more-about-dgraph-zero)

---

<div class="post-metadata">

**Author:** ![seanlaff](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/seanlaff/32/2142_2.png) [@seanlaff](https://discuss.dgraph.io/u/seanlaff)\
**Post date:** [August 10, 2020, 10:20pm UTC](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491/23 "2020-08-10T22:20:04Z")

</div>

@MichelDiz would you be able to elaborate on the implications of leasing out so many uids at once? I assume there would have to be a tradeoff for doing so, right?

---

<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:** [August 10, 2020, 10:37pm UTC](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491/24 "2020-08-10T22:37:19Z")

</div>

Honestly, I can’t see any tradeoff/issue. The leasing will increase just a little bit the storage usage things like 10 ~ 200 MB if you lease 300 million UIDs. That’s not even an issue. Also, the Zero would have to lease it (processing task). That’s all.

> [@Supernode Problem](http://discuss.hypermode.com/t/supernode-problem/5921):
>
> How does dgraph deal with supernode problem? For example in, Twitter, most followed person has ~112 million followers Instagram, Instagram account has ~331 million followers That means a single posting list for such vertex:follower is 331 million \* 64 bits (UID size) ~= 21,184,000,000 bits ~= 2.7 GBs! How does dgrah deal with Queries/Upserts, which try to get all followers? (even with filters, does dgraph load all followers and apply filter, maybe leading to OOM?) Writes will be impacted…

Ah, also you have to deal with millions/billions of UIDs on your end. That’s something. Unless you do the conversion hex to uid.

[Previous page](https://discuss.dgraph.io/t/how-to-update-a-large-amount-of-data-in-dgraph-every-day/5491.md?page=1)
