# How to Data Incremental Update

**URL:** <https://discuss.dgraph.io/t/how-to-data-incremental-update/4470>\
**Category:** Dgraph\
**Created:** [May 15, 2019, 9:07am UTC](https://discuss.dgraph.io/t/how-to-data-incremental-update/4470 "2019-05-15T09:07:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeahvip](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yeahvip/32/2683_2.png) [@yeahvip](https://discuss.dgraph.io/u/yeahvip)\
**Post date:** [May 15, 2019, 9:07am UTC](https://discuss.dgraph.io/t/how-to-data-incremental-update/4470/1 "2019-05-15T09:07:41Z")

</div>

Recently I use Dgraph to store hollywood star information using spyder. I save the data and relation directly to dgraph at the beginning. But with the growth of acquisition time, I should retrieve whether the obtained data is in dgraph and get uid of this data. Is there any other good way to incrementally update data? E.g. when I have some hollywood star information in dgraph, then i know that Vin Diesel is the partner of dwayne Johnson, then i need to query the uid of diesel and johnson in dgraph separately to avoid the generation of redundant nodes, then using the uid to stock this rdf.

---

<div class="post-metadata">

**Author:** ![dmai](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/dmai/32/1254_2.png) [@dmai](https://discuss.dgraph.io/u/dmai)\
**Post date:** [May 16, 2019, 4:47am UTC](https://discuss.dgraph.io/t/how-to-data-incremental-update/4470/2 "2019-05-16T04:47:46Z")

</div>

> [@yeahvip](#):
>
> E.g. when I have some hollywood star information in dgraph, then i know that Vin Diesel is the partner of dwayne Johnson, then i need to query the uid of diesel and johnson in dgraph separately to avoid the generation of redundant nodes, then using the uid to stock this rdf.

This is exactly how you should do this. You can query-then-mutate in a single transaction.

---

<div class="post-metadata">

**Author:** ![yeahvip](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yeahvip/32/2683_2.png) [@yeahvip](https://discuss.dgraph.io/u/yeahvip)\
**Post date:** [May 20, 2019, 2:11am UTC](https://discuss.dgraph.io/t/how-to-data-incremental-update/4470/3 "2019-05-20T02:11:03Z")

</div>

But if I want to update billions of rdfs? When i use dgraph live, RDFs processed per second can be 3000. But if I query-then-mutate, RDFs processed per second can only be hundreds of orders of magnitude. Is there any other better way to incrementally add data? In my application scenario, I started with only little data, most of the data is entered after the acquisition.
