# External versioning (external or external\_gte)

**URL:** <https://discuss.elastic.co/t/external-versioning-external-or-external-gte/106289>\
**Category:** Elasticsearch\
**Created:** [November 3, 2017, 9:02am UTC](https://discuss.elastic.co/t/external-versioning-external-or-external-gte/106289 "2017-11-03T09:02:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piotr.dela](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@piotr.dela](https://discuss.elastic.co/u/piotr.dela)\
**Post date:** [November 3, 2017, 9:02am UTC](https://discuss.elastic.co/t/external-versioning-external-or-external-gte/106289/1 "2017-11-03T09:02:57Z")

</div>

Hi folks,

I'm currently working on a project which has a "projection" storage implemented using Elasticsearch. I have a few questions about external versioning.

First of all in general, in documentation it is said

> Blockquote  
> external\_gte version type is meant for special use cases and should be used with care. If used incorrectly, it can result in loss of data  
> Blockquote

Why exactly it is so? Can you provide more details?

In my case in primary storage let's say I keep a set of entities and every single of them has a version number. And now it is possible to perform two kind of operations:

1. User make changes to a single entity which will internally cause version of entity be incremented. Then system schedules an operation which will create a document based on entity data and then index in Elasticsearch.

2. Someone from support team would like to recreate/refresh projection storage based on data kept in primary storage using bulk request. In this case version of entity might not change.

So, I thought of using external/external\_gt for a first case and external\_gte for second scenario. Another option is to use external\_gte version type for both scenarios but I'm wondering what is a reason not to use it?

Do you have any recommendation to this case?

Thanks,  
Piotr

---

<div class="post-metadata">

**Author:** ![mirek](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mirek](https://discuss.elastic.co/u/mirek)\
**Post date:** [November 9, 2017, 9:23pm UTC](https://discuss.elastic.co/t/external-versioning-external-or-external-gte/106289/2 "2017-11-09T21:23:42Z")

</div>

It seems that this question was asked (but not answered) some time ago as well

> [@Why does the external\_gte version type need to be used with care?](https://discuss.elastic.co/t/why-does-the-external-gte-version-type-need-to-be-used-with-care/60445):
>
> The [documentation for the index API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#_version_types) says this about the external\_gte version type: NOTE: The external\_gte & force version types are meant for special use cases and should be used with care. If used incorrectly, they can result in loss of data. What is the reason that the external\_gte version types needs to be used with care? What type of care needs to be used? How can the external\_gte version type result in data loss? Is the issue that a failure of the external system to properly update the…

In our case we have database where every entity is versioned. Can we use this entity version number with external\_gte?

It's seams that using external\_gte would work for us because we can easily "Reindex" entire database when we suspect it got out of sync with ES index.

Do you think we miss something in our understanding?

Mirek

---

<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 7, 2017, 9:25pm UTC](https://discuss.elastic.co/t/external-versioning-external-or-external-gte/106289/3 "2017-12-07T21:25:53Z")

</div>

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