# Client question

**URL:** <https://discuss.elastic.co/t/client-question/7725>\
**Category:** Elasticsearch\
**Created:** [May 16, 2012, 6:21pm UTC](https://discuss.elastic.co/t/client-question/7725 "2012-05-16T18:21:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [May 16, 2012, 6:21pm UTC](https://discuss.elastic.co/t/client-question/7725/1 "2012-05-16T18:21:32Z")

</div>

Which is better for performance embedded client or transport client? How  
should one decide which one to use?

And, how does embedded client join the cluster?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 17, 2012, 10:15pm UTC](https://discuss.elastic.co/t/client-question/7725/2 "2012-05-17T22:15:36Z")

</div>

What are you missing in the explanation here:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).

On Wed, May 16, 2012 at 9:21 PM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:

> Which is better for performance embedded client or transport client? How  
> should one decide which one to use?
> 
> And, how does embedded client join the cluster?

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [May 17, 2012, 11:29pm UTC](https://discuss.elastic.co/t/client-question/7725/3 "2012-05-17T23:29:04Z")

</div>

Looks like embedded client is preferred, but I don't understand how  
Transport client causes 2 hops but embedded client doesn't? Data still need  
to be streamed correct?

On Thu, May 17, 2012 at 3:15 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> What are you missing in the explanation here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).
> 
> On Wed, May 16, 2012 at 9:21 PM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:
> 
> > Which is better for performance embedded client or transport client? How  
> > should one decide which one to use?
> > 
> > And, how does embedded client join the cluster?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 20, 2012, 8:11pm UTC](https://discuss.elastic.co/t/client-question/7725/4 "2012-05-20T20:11:43Z")

</div>

Data is sent in any case yes. Lets take indexing for example, the node  
client will know exactly which shard to index into, and will send the  
indexing request directly to it. The transport client will simply pick one  
of the nodes, and send the request to it, if that node holds the relevant  
shard, thats great, if not, the node will redirect the request to the  
relevant node where the shard exists.

On Fri, May 18, 2012 at 1:29 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:

> Looks like embedded client is preferred, but I don't understand how  
> Transport client causes 2 hops but embedded client doesn't? Data still need  
> to be streamed correct?
> 
> On Thu, May 17, 2012 at 3:15 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > What are you missing in the explanation here:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).
> > 
> > On Wed, May 16, 2012 at 9:21 PM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:
> > 
> > > Which is better for performance embedded client or transport client? How  
> > > should one decide which one to use?
> > > 
> > > And, how does embedded client join the cluster?

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [May 20, 2012, 11:20pm UTC](https://discuss.elastic.co/t/client-question/7725/5 "2012-05-20T23:20:19Z")

</div>

got it. Thanks!

On Sun, May 20, 2012 at 1:11 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Data is sent in any case yes. Lets take indexing for example, the node  
> client will know exactly which shard to index into, and will send the  
> indexing request directly to it. The transport client will simply pick one  
> of the nodes, and send the request to it, if that node holds the relevant  
> shard, thats great, if not, the node will redirect the request to the  
> relevant node where the shard exists.
> 
> On Fri, May 18, 2012 at 1:29 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:
> 
> > Looks like embedded client is preferred, but I don't understand how  
> > Transport client causes 2 hops but embedded client doesn't? Data still need  
> > to be streamed correct?
> > 
> > On Thu, May 17, 2012 at 3:15 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > What are you missing in the explanation here:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).
> > > 
> > > On Wed, May 16, 2012 at 9:21 PM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:
> > > 
> > > > Which is better for performance embedded client or transport client?  
> > > > How should one decide which one to use?
> > > > 
> > > > And, how does embedded client join the cluster?

---

<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:27am UTC](https://discuss.elastic.co/t/client-question/7725/6 "2017-07-06T03:27:55Z")

</div>


