# True embedded mode

**URL:** <https://discuss.elastic.co/t/true-embedded-mode/23204>\
**Category:** Elasticsearch\
**Created:** [April 13, 2015, 3:07am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204 "2015-04-13T03:07:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@Ted\_Smith](https://discuss.elastic.co/u/Ted_Smith)\
**Post date:** [April 13, 2015, 3:07am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/1 "2015-04-13T03:07:31Z")

</div>

Hello:

I am running ES with one Node, one Shard in embedded Java app.  
Does Node client run in "true" embedded mode or is it still going  
through the client server data flow?

If I create a Search Request, object and excute it, get it,  
would ES first serialize it into Json data and send to a server thread  
which would deserialize it, and then get result, convert it to Json  
and send back to client, which would convert it into java object?

I'd expect in "true" embedded mode, the search object and result object  
would be directly pass in and out, without the overhead of client-server  
mode,  
which could be huge performance gain.

Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [April 13, 2015, 6:24am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/2 "2015-04-13T06:24:52Z")

</div>

Hello Ted ,

If you are using transport client as told in the link below , you should be  
using embedded soltuion.

LINK -

> **[Client | Java Transport Client (deprecated) \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html#transport-client)**

If its HTTP , then it tries to talk through the port and might try all the  
serialization/deserialization stuff.

Thanks  
Vineeth Mohan,  
Elasticsearch consultant,  
[qbox.io](http://qbox.io) ( Elasticsearch service provider [http://qbox.io/](http://qbox.io/))

On Mon, Apr 13, 2015 at 8:37 AM, Ted Smith [tedsmithgroup@gmail.com](mailto:tedsmithgroup@gmail.com) wrote:

> Hello:
> 
> I am running ES with one Node, one Shard in embedded Java app.  
> Does Node client run in "true" embedded mode or is it still going  
> through the client server data flow?
> 
> If I create a Search Request, object and excute it, get it,  
> would ES first serialize it into Json data and send to a server thread  
> which would deserialize it, and then get result, convert it to Json  
> and send back to client, which would convert it into java object?
> 
> I'd expect in "true" embedded mode, the search object and result object  
> would be directly pass in and out, without the overhead of client-server  
> mode,  
> which could be huge performance gain.
> 
> Thanks
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nuz9TaPggFrrswGKWA49hnDB5h50GH2uVKRcNqZDUMyQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nuz9TaPggFrrswGKWA49hnDB5h50GH2uVKRcNqZDUMyQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ted\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@Ted\_Smith](https://discuss.elastic.co/u/Ted_Smith)\
**Post date:** [April 13, 2015, 11:43am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/3 "2015-04-13T11:43:37Z")

</div>

But TransportClient is to use network connection to a server, which is not  
what I was looking for.

On Sunday, April 12, 2015 at 11:07:31 PM UTC-4, Ted Smith wrote:

> Hello:
> 
> I am running ES with one Node, one Shard in embedded Java app.  
> Does Node client run in "true" embedded mode or is it still going  
> through the client server data flow?
> 
> If I create a Search Request, object and excute it, get it,  
> would ES first serialize it into Json data and send to a server thread  
> which would deserialize it, and then get result, convert it to Json  
> and send back to client, which would convert it into java object?
> 
> I'd expect in "true" embedded mode, the search object and result object  
> would be directly pass in and out, without the overhead of client-server  
> mode,  
> which could be huge performance gain.
> 
> Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5aa70ca9-1db5-416a-970f-4d519eb6d635%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5aa70ca9-1db5-416a-970f-4d519eb6d635%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 13, 2015, 11:49am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/4 "2015-04-13T11:49:51Z")

</div>

All requests are serialized and deserialized at shard level, it is the only  
method of creating executable Lucene queries. There is no "client-server  
mode" at shard level. There would be no huge performance gain of "directly  
pass in and out", there is nothing much to win, because sooner or later you  
need executable Lucene query objects for this shard.

Jörg

On Mon, Apr 13, 2015 at 5:07 AM, Ted Smith [tedsmithgroup@gmail.com](mailto:tedsmithgroup@gmail.com) wrote:

> Hello:
> 
> I am running ES with one Node, one Shard in embedded Java app.  
> Does Node client run in "true" embedded mode or is it still going  
> through the client server data flow?
> 
> If I create a Search Request, object and excute it, get it,  
> would ES first serialize it into Json data and send to a server thread  
> which would deserialize it, and then get result, convert it to Json  
> and send back to client, which would convert it into java object?
> 
> I'd expect in "true" embedded mode, the search object and result object  
> would be directly pass in and out, without the overhead of client-server  
> mode,  
> which could be huge performance gain.
> 
> Thanks
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/837f8bc5-7266-4673-84d4-44a73dde7cb9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGMXPVmTD%2Bp5LEZu2g%3D%2BhhpTF38EROELROAZqocmdxbvA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGMXPVmTD%2Bp5LEZu2g%3D%2BhhpTF38EROELROAZqocmdxbvA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [April 13, 2015, 12:38pm UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/5 "2015-04-13T12:38:18Z")

</div>

There is a "local" mode [1]. In this mode you start up the single embedded  
node and use the client from that node [2], which will bypass networking  
but responses are still serialized to bytes [3].

[1]

> **[Client | Java Transport Client (deprecated) \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html#node-client)**

[2] [https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/node/Node.java#L223](https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/node/Node.java#L223)  
[3] [https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/transport/local/LocalTransport.java](https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/transport/local/LocalTransport.java)

On Sunday, April 12, 2015 at 11:07:31 PM UTC-4, Ted Smith wrote:

> Hello:
> 
> I am running ES with one Node, one Shard in embedded Java app.  
> Does Node client run in "true" embedded mode or is it still going  
> through the client server data flow?
> 
> If I create a Search Request, object and excute it, get it,  
> would ES first serialize it into Json data and send to a server thread  
> which would deserialize it, and then get result, convert it to Json  
> and send back to client, which would convert it into java object?
> 
> I'd expect in "true" embedded mode, the search object and result object  
> would be directly pass in and out, without the overhead of client-server  
> mode,  
> which could be huge performance gain.
> 
> Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1cca84a4-6b1c-4ba0-96dd-b4e6ec778523%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1cca84a4-6b1c-4ba0-96dd-b4e6ec778523%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ted\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@Ted\_Smith](https://discuss.elastic.co/u/Ted_Smith)\
**Post date:** [April 14, 2015, 8:48pm UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/6 "2015-04-14T20:48:20Z")

</div>

I have use cases involving many requests with many fields in response.  
seril/deserl consume a lot of resource.

it would help a lot if there is a "true" embedded client that would  
directly interact  
with shard (single node, single shard) by passing/returning java object  
directly.

On Monday, April 13, 2015 at 8:38:18 AM UTC-4, Jay Modi wrote:

> There is a "local" mode [1]. In this mode you start up the single embedded  
> node and use the client from that node [2], which will bypass networking  
> but responses are still serialized to bytes [3].
> 
> [1]  
> [Client | Java Transport Client (deprecated) [7.17] | Elastic](http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html#node-client)  
> [2]  
> [https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/node/Node.java#L223](https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/node/Node.java#L223)  
> [3]  
> [https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/transport/local/LocalTransport.java](https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/transport/local/LocalTransport.java)
> 
> On Sunday, April 12, 2015 at 11:07:31 PM UTC-4, Ted Smith wrote:
> 
> > Hello:
> > 
> > I am running ES with one Node, one Shard in embedded Java app.  
> > Does Node client run in "true" embedded mode or is it still going  
> > through the client server data flow?
> > 
> > If I create a Search Request, object and excute it, get it,  
> > would ES first serialize it into Json data and send to a server thread  
> > which would deserialize it, and then get result, convert it to Json  
> > and send back to client, which would convert it into java object?
> > 
> > I'd expect in "true" embedded mode, the search object and result object  
> > would be directly pass in and out, without the overhead of client-server  
> > mode,  
> > which could be huge performance gain.
> > 
> > Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1ac9ef6f-05a5-4efa-8377-e876ff05cb59%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1ac9ef6f-05a5-4efa-8377-e876ff05cb59%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:19am UTC](https://discuss.elastic.co/t/true-embedded-mode/23204/7 "2017-07-06T00:19:49Z")

</div>


