# Best practice for denormalize Relational database table to Elasticsearch

**URL:** https://discuss.elastic.co/t/best-practice-for-denormalize-relational-database-table-to-elasticsearch/206404
**Category:** Elasticsearch
**Created:** [November 4, 2019, 12:57pm UTC](https://discuss.elastic.co/t/best-practice-for-denormalize-relational-database-table-to-elasticsearch/206404 "2019-11-04T12:57:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![LinJIngYun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linjingyun/32/44151_2.png) [@LinJIngYun](https://discuss.elastic.co/u/LinJIngYun)
#### Post date: [November 4, 2019, 12:57pm UTC](https://discuss.elastic.co/t/best-practice-for-denormalize-relational-database-table-to-elasticsearch/206404/1 "2019-11-04T12:57:49Z")

</div>

Greeting everybody.  
How I can denormalize MongoDB(normalize) collections that have relation between collections (joined) and insert it to Elasticsearch (denormalized data)?  
For now I have an simplest ways is Create API that perform aggrwgation lookup in MongoDB and return all data in REST API then Logstash going to retrive data from that API.  
This is the simplest ways that I can thonk about it.  
Is it have another way? Or perhaps I can perform MongoDB query on Logstash ?  
Thank you very muxh for your answer 🙂

---

<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: [December 2, 2019, 12:58pm UTC](https://discuss.elastic.co/t/best-practice-for-denormalize-relational-database-table-to-elasticsearch/206404/2 "2019-12-02T12:58:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
