# Relational Data Modelling in Elasticsearch

**URL:** <https://discuss.elastic.co/t/relational-data-modelling-in-elasticsearch/20735>\
**Category:** Elasticsearch\
**Created:** [November 13, 2014, 7:34pm UTC](https://discuss.elastic.co/t/relational-data-modelling-in-elasticsearch/20735 "2014-11-13T19:34:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philip\_K\_Adetiloye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philip_k_adetiloye/32/14386_2.png) [@Philip\_K\_Adetiloye](https://discuss.elastic.co/u/Philip_K_Adetiloye)\
**Post date:** [November 13, 2014, 7:34pm UTC](https://discuss.elastic.co/t/relational-data-modelling-in-elasticsearch/20735/1 "2014-11-13T19:34:09Z")

</div>

I'm indexing data from a relational database to Elasticsearch which  
requires  
several joins across multiple tables.

Now, am thinking if using Nested object to model my relationship would be a  
good idea.

Basically, I want to create separate batch jobs for each related tables to  
push data  
from the database to ES using bulk UPSERT.

i.e if the document id exist, partially update the child (nested) document  
otherwise, creates a new document, set the id and partially update  
the child (nested) document.

Would there be a big performance hit if I have 5 jobs doing partial updates  
on each document (x 1+ million documents) on my index?

My data rarely change once it's indexed and so far I've not seen any  
disadvantage of using nested objects.

Please advise.

Thanks,

- Phil

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fae0f08c-511a-4274-95f2-a58fe2df63e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fae0f08c-511a-4274-95f2-a58fe2df63e7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Matthew\_Kaufman](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@Matthew\_Kaufman](https://discuss.elastic.co/u/Matthew_Kaufman)\
**Post date:** [November 14, 2014, 5:26am UTC](https://discuss.elastic.co/t/relational-data-modelling-in-elasticsearch/20735/2 "2014-11-14T05:26:37Z")

</div>

Just cluster it if you need to have a better performance out of your index  
update bulk upsert runs...

On Thursday, November 13, 2014 2:34:09 PM UTC-5, Philip K. Adetiloye wrote:

> I'm indexing data from a relational database to Elasticsearch which  
> requires  
> several joins across multiple tables.
> 
> Now, am thinking if using Nested object to model my relationship would be  
> a good idea.
> 
> Basically, I want to create separate batch jobs for each related tables to  
> push data  
> from the database to ES using bulk UPSERT.
> 
> i.e if the document id exist, partially update the child (nested)  
> document otherwise, creates a new document, set the id and partially  
> update  
> the child (nested) document.
> 
> Would there be a big performance hit if I have 5 jobs doing partial  
> updates on each document (x 1+ million documents) on my index?
> 
> My data rarely change once it's indexed and so far I've not seen any  
> disadvantage of using nested objects.
> 
> Please advise.
> 
> Thanks,
> 
> - Phil

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f2afba1c-d14a-4591-b750-f0e1ece7b814%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2afba1c-d14a-4591-b750-f0e1ece7b814%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:50am UTC](https://discuss.elastic.co/t/relational-data-modelling-in-elasticsearch/20735/3 "2017-07-06T00:50:01Z")

</div>


