# Versioning for time series data

**URL:** <https://discuss.elastic.co/t/versioning-for-time-series-data/10694>\
**Category:** Elasticsearch\
**Created:** [February 11, 2013, 3:48pm UTC](https://discuss.elastic.co/t/versioning-for-time-series-data/10694 "2013-02-11T15:48:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pr2012](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pr2012/32/2186_2.png) [@pr2012](https://discuss.elastic.co/u/pr2012)\
**Post date:** [February 11, 2013, 3:48pm UTC](https://discuss.elastic.co/t/versioning-for-time-series-data/10694/1 "2013-02-11T15:48:38Z")

</div>

Hi.

We are replacing a fairly flat mysql database with elasticsearch. One of  
the things we store currently is a time-series of scores. Lots and lots of  
rows for a given foreign key. One thing I like about elasticsearch is that  
versioning is baked in. The current thinking is to use versioning for  
storing the timeseries of scores.

So instead of many rows of scores for a given object in mysql, we would  
have 1 score document in elasticsearch. Each score change would be a  
different version. This would however lead to 10s of not 100s of thousands  
of versions for a given document.

At what point should we be worried about elasticsearch's ability to  
reliably quickly go through versions? Is there a capability in the API to  
request a range of versions for a given document?

thx!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 11, 2013, 3:59pm UTC](https://discuss.elastic.co/t/versioning-for-time-series-data/10694/2 "2013-02-11T15:59:07Z")

</div>

> At what point should we be worried about elasticsearch's ability to  
> reliably quickly go through versions? Is there a capability in the API  
> to request a range of versions for a given document?

There is only a single version of the document, with the current version  
number.

clint

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jeffrey\_Gerard](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jeffrey\_Gerard](https://discuss.elastic.co/u/Jeffrey_Gerard)\
**Post date:** [February 12, 2013, 5:29pm UTC](https://discuss.elastic.co/t/versioning-for-time-series-data/10694/3 "2013-02-12T17:29:43Z")

</div>

More context: I think Elasticsearch's versioning is really only for optimistic  
concurrency control[http://www.elasticsearch.org/blog/2011/02/08/versioning.html](http://www.elasticsearch.org/blog/2011/02/08/versioning.html).  
It does not persist old versions of a document; its concept of "versioning"  
is merely a number that gets updated when the document is overwritten.

You could still use Elasticsearch to maintain a time series, but not using  
their built-in versioning feature. Take a peek at  
[http://stackoverflow.com/questions/8218309/can-we-retrieve-previous-source-docs-with-elastic-search-versions](http://stackoverflow.com/questions/8218309/can-we-retrieve-previous-source-docs-with-elastic-search-versions)  
for some approaches. Your use case may be simpler still, e.g. you could  
store the "timestamp" as a field and do range queries over it, but keep in  
mind you'd have the extra overhead of duplicating the rest of the  
documents' fields for each timestamp.

On Monday, February 11, 2013 7:59:07 AM UTC-8, Clinton Gormley wrote:

> > At what point should we be worried about elasticsearch's ability to  
> > reliably quickly go through versions? Is there a capability in the API  
> > to request a range of versions for a given document?
> 
> There is only a single version of the document, with the current version  
> number.
> 
> clint

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:51am UTC](https://discuss.elastic.co/t/versioning-for-time-series-data/10694/4 "2017-07-06T02:51:51Z")

</div>


