# How to Maintain the CDC(Change data capture) in elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-maintain-the-cdc-change-data-capture-in-elasticsearch/161650>\
**Category:** Elasticsearch\
**Created:** [December 20, 2018, 9:38am UTC](https://discuss.elastic.co/t/how-to-maintain-the-cdc-change-data-capture-in-elasticsearch/161650 "2018-12-20T09:38:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suneeld](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@suneeld](https://discuss.elastic.co/u/suneeld)\
**Post date:** [December 20, 2018, 9:38am UTC](https://discuss.elastic.co/t/how-to-maintain-the-cdc-change-data-capture-in-elasticsearch/161650/1 "2018-12-20T09:38:23Z")

</div>

I would like to Maintain the CDC logic(scd type2) in elasticsearch, so that I should be able to distinguish the data between current record Vs Previous record, for my high volume changes.

Example :-  
{ text: "foo bar",  
date: "2011-11-01",  
previous: [  
{ date: '2011-10-01', content: { text: 'Foo Bar' }},  
{ date: '2011-09-01', content: { text: 'Foo-bar!' }},  
]  
}

Is there any suggestion, best practices and solution would be appreciated .

Thanks In advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 25, 2018, 6:34am UTC](https://discuss.elastic.co/t/how-to-maintain-the-cdc-change-data-capture-in-elasticsearch/161650/2 "2018-12-25T06:34:07Z")

</div>

There is no support for this natively in Elasticsearch, so as far as I know this is something you would need to implement yourself as part of the application layer indexing into Elasticsearch.

---

<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:** [January 22, 2019, 6:34am UTC](https://discuss.elastic.co/t/how-to-maintain-the-cdc-change-data-capture-in-elasticsearch/161650/3 "2019-01-22T06:34:23Z")

</div>

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