# Fastest API

**URL:** <https://discuss.elastic.co/t/fastest-api/9682>\
**Category:** Elasticsearch\
**Created:** [November 12, 2012, 8:15pm UTC](https://discuss.elastic.co/t/fastest-api/9682 "2012-11-12T20:15:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Verlangen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_verlangen/32/1542_2.png) [@Robin\_Verlangen](https://discuss.elastic.co/u/Robin_Verlangen)\
**Post date:** [November 12, 2012, 8:15pm UTC](https://discuss.elastic.co/t/fastest-api/9682/1 "2012-11-12T20:15:26Z")

</div>

Hi there,

What would be the fastest API of ES? We use Java as client, so my guess  
would be the java API. Does anyone have some internal information about why  
that would be the fastest?

Best regards,

Robin Verlangen  
_Software engineer_  
\*  
\*  
W [http://www.robinverlangen.nl](http://www.robinverlangen.nl)  
E robin@us2.nl

[http://goo.gl/Lt7BC](http://goo.gl/Lt7BC)

Disclaimer: The information contained in this message and attachments is  
intended solely for the attention and use of the named addressee and may be  
confidential. If you are not the intended recipient, you are reminded that  
the information remains the property of the sender. You must not use,  
disclose, distribute, copy, print or rely on this e-mail. If you have  
received this message in error, please contact the sender immediately and  
irrevocably delete this message and any copies.

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [November 12, 2012, 10:04pm UTC](https://discuss.elastic.co/t/fastest-api/9682/2 "2012-11-12T22:04:18Z")

</div>

Most other clients use the REST protocol which eventually get converted  
into the Java API on the server side, so they all have some overhead. The  
time difference in clients is negligible compared to execution time of a  
query.

--  
Ivan

On Mon, Nov 12, 2012 at 12:15 PM, Robin Verlangen [robin@us2.nl](mailto:robin@us2.nl) wrote:

> Hi there,
> 
> What would be the fastest API of ES? We use Java as client, so my guess  
> would be the java API. Does anyone have some internal information about why  
> that would be the fastest?
> 
> Best regards,
> 
> Robin Verlangen  
> _Software engineer_  
> \*  
> \*  
> W [http://www.robinverlangen.nl](http://www.robinverlangen.nl)  
> E robin@us2.nl
> 
> [http://goo.gl/Lt7BC](http://goo.gl/Lt7BC)
> 
> Disclaimer: The information contained in this message and attachments is  
> intended solely for the attention and use of the named addressee and may be  
> confidential. If you are not the intended recipient, you are reminded that  
> the information remains the property of the sender. You must not use,  
> disclose, distribute, copy, print or rely on this e-mail. If you have  
> received this message in error, please contact the sender immediately and  
> irrevocably delete this message and any copies.
> 
> --

--

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [November 13, 2012, 3:21am UTC](https://discuss.elastic.co/t/fastest-api/9682/3 "2012-11-13T03:21:37Z")

</div>

Robin Verlangen wrote:

> > What would be the fastest API of ES? We use Java as client, so my  
> > guess would be the java API. Does anyone have some internal  
> > information about why that would be the fastest?

Ivan Brusic wrote:

> Most other clients use the REST protocol which eventually get  
> converted into the Java API on the server side, so they all have  
> some overhead. The time difference in clients is negligible  
> compared to execution time of a query.

At Sonian we used the Java client for heavy bulk indexing of large  
documents before trying the REST client to give us better resiliency  
in the face of ES version changes. We had decided the tradeoff was  
worth it even if it slowed us down slightly. In the end it turned  
out to be comparable in speed. Most of the same de/serialization has  
to happen for both clients, which pales in comparison to the IO  
required to write data and do large queries.

It's best to profile your data with both and make an informed choice.

-Drew

--

---

<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:** [November 14, 2012, 1:37am UTC](https://discuss.elastic.co/t/fastest-api/9682/4 "2012-11-14T01:37:04Z")

</div>

The Java API is the native API of ES - there is nothing "faster". It's  
difficult what you mean by "fast" since there is nothing in an API you can  
call "fast", so I think you are refering to the perceivable response time  
of different protocol mechanisms for performing operations, like HTTP REST  
or the binary transport protocol between nodes. Because ES API is  
asynchronous, you will get responses as soon as ES can react, not  
necessarily as soon as the operation is complete. In comparison to the time  
required to perform the underlying operations and the network delay, the  
time spent in the protocol layer is not significant. But, in the case you  
refer to use cases like bulk data ingest, it is true that different  
protocol overheads tend to sum up. It also depends on your data and your  
environment. You can control the efficiency by chosing configuration  
settings, compression algorithms, bulk transport, asynchronous operation  
mode, load balancing, query optimization, Lucene tuning - whatever you  
prefer.

Jörg

On Monday, November 12, 2012 9:15:31 PM UTC+1, Robin Verlangen wrote:

> Hi there,
> 
> What would be the fastest API of ES? We use Java as client, so my guess  
> would be the java API. Does anyone have some internal information about why  
> that would be the fastest?
> 
> Best regards,
> 
> Robin Verlangen  
> _Software engineer_  
> \*  
> \*  
> W [http://www.robinverlangen.nl](http://www.robinverlangen.nl)  
> E ro...@us2.nl \<javascript:\>
> 
> [http://goo.gl/Lt7BC](http://goo.gl/Lt7BC)
> 
> Disclaimer: The information contained in this message and attachments is  
> intended solely for the attention and use of the named addressee and may be  
> confidential. If you are not the intended recipient, you are reminded that  
> the information remains the property of the sender. You must not use,  
> disclose, distribute, copy, print or rely on this e-mail. If you have  
> received this message in error, please contact the sender immediately and  
> irrevocably delete this message and any copies.

--

---

<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:04am UTC](https://discuss.elastic.co/t/fastest-api/9682/5 "2017-07-06T03:04:27Z")

</div>


