# Node replication

**URL:** <https://discuss.elastic.co/t/node-replication/8856>\
**Category:** Elasticsearch\
**Created:** [August 27, 2012, 2:24am UTC](https://discuss.elastic.co/t/node-replication/8856 "2012-08-27T02:24:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [August 27, 2012, 2:24am UTC](https://discuss.elastic.co/t/node-replication/8856/1 "2012-08-27T02:24:13Z")

</div>

Hello there! We are using ES to replace our search (endeca) stack, and we  
loved it so much, that we actually decided to use it for other things. We  
have a requirement on a token service, and instead of using a mongodb or  
memcached we decided to use ES, it has the json schema from mongo and the  
TTL that a cache can give you. Besides, 90% of the queries will be simple  
gets on an index: /tokens/token/{id} a few will be some queries on two  
indexed fields.

Our search is not realtime, so we do not care about consistency on the  
nodes in a window of few minutes, but the token service has to be  
consistent.

So, my question is, if I have a cluster of 3 nodes, with replication (no  
shards, the index should be small \< 200k elements per day, and we will use  
a 1d TTL), let's say the token server adds a token in node A, a few seconds  
later a client queries node B for the given token. If it does not find it  
(using GET), will it check the other nodes before failing? Is there any way  
to control this?

I know you can control the search type, but what about the GET operation?

Regards

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 27, 2012, 6:06am UTC](https://discuss.elastic.co/t/node-replication/8856/2 "2012-08-27T06:06:30Z")

</div>

It won't fail. If your document exists somewhere in the cluster, you will get it.

You don't have to worry about the node you query on.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 août 2012 à 04:24, Vinicius Carvalho [viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) a écrit :

> Hello there! We are using ES to replace our search (endeca) stack, and we loved it so much, that we actually decided to use it for other things. We have a requirement on a token service, and instead of using a mongodb or memcached we decided to use ES, it has the json schema from mongo and the TTL that a cache can give you. Besides, 90% of the queries will be simple gets on an index: /tokens/token/{id} a few will be some queries on two indexed fields.
> 
> Our search is not realtime, so we do not care about consistency on the nodes in a window of few minutes, but the token service has to be consistent.
> 
> So, my question is, if I have a cluster of 3 nodes, with replication (no shards, the index should be small \< 200k elements per day, and we will use a 1d TTL), let's say the token server adds a token in node A, a few seconds later a client queries node B for the given token. If it does not find it (using GET), will it check the other nodes before failing? Is there any way to control this?
> 
> I know you can control the search type, but what about the GET operation?
> 
> ## Regards

--

---

<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:** [August 27, 2012, 8:23am UTC](https://discuss.elastic.co/t/node-replication/8856/3 "2012-08-27T08:23:30Z")

</div>

Hi Vinicius

On Mon, 2012-08-27 at 08:06 +0200, David Pilato wrote:

> It won't fail. If your document exists somewhere in the cluster, you  
> will get it.

> You don't have to worry about the node you query on.

To add to the above, take a look at one of my Perl modules:  
[https://metacpan.org/module/ElasticSearchX::UniqueKey](https://metacpan.org/module/ElasticSearchX::UniqueKey)

which has a lot in common with what you want to do.

Specifically, have a look at how I create the index:  
[https://metacpan.org/source/DRTECH/ElasticSearchX-UniqueKey-0.03/lib/ElasticSearchX/UniqueKey.pm#L164](https://metacpan.org/source/DRTECH/ElasticSearchX-UniqueKey-0.03/lib/ElasticSearchX/UniqueKey.pm#L164)

I'm not using TTL in this case, as my unique keys are supposed to  
endure, but disabling \_all and \_source indexing will work well with what  
you want to achieve.

clint

> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 27 août 2012 à 04:24, Vinicius Carvalho  
> [viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) a écrit :
> 
> > Hello there! We are using ES to replace our search (endeca) stack,  
> > and we loved it so much, that we actually decided to use it for  
> > other things. We have a requirement on a token service, and instead  
> > of using a mongodb or memcached we decided to use ES, it has the  
> > json schema from mongo and the TTL that a cache can give you.  
> > Besides, 90% of the queries will be simple gets on an  
> > index: /tokens/token/{id} a few will be some queries on two indexed  
> > fields.
> > 
> > Our search is not realtime, so we do not care about consistency on  
> > the nodes in a window of few minutes, but the token service has to  
> > be consistent.
> > 
> > So, my question is, if I have a cluster of 3 nodes, with replication  
> > (no shards, the index should be small \< 200k elements per day, and  
> > we will use a 1d TTL), let's say the token server adds a token in  
> > node A, a few seconds later a client queries node B for the given  
> > token. If it does not find it (using GET), will it check the other  
> > nodes before failing? Is there any way to control this?
> > 
> > I know you can control the search type, but what about the GET  
> > operation?
> > 
> > Regards

--

---

<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, 3:14am UTC](https://discuss.elastic.co/t/node-replication/8856/4 "2017-07-06T03:14:58Z")

</div>

Closed on July 6, 2017, 3:14am UTC


