# Are there any advantages when using the REST API in a JVM app?

**URL:** <https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 5:51am UTC](https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756 "2016-03-30T05:51:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hariso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hariso/32/50668_2.png) [@hariso](https://discuss.elastic.co/u/hariso)\
**Post date:** [March 30, 2016, 5:51am UTC](https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756/1 "2016-03-30T05:51:42Z")

</div>

Hi everyone!

In an application I am working on, we are using a node client to access an ES cluster. We are evaluating a switch to the REST API.

However, from what I could find so far, the main purpose of the REST API is to have a way for non-JVM apps to communicate with ES and so that version upgrades are less painful.

Reading the docs, I could see that since version 1.x or so, clients are able to talk to a cluster, as long as they have the same version. That makes me think, that the only advantage of using the REST API in a JVM app could be to have a smoother upgrade from one major version to another.

Given that major version give some breaking changes and major features, it will still need a rewrite of part of client code, so the benefit is quite relative.

My question is: are my assumptions correct? Is there some really strong benefit in using the REST API in a JVM app?

Best wishes,

Haris

---

<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:** [March 30, 2016, 6:22am UTC](https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756/2 "2016-03-30T06:22:46Z")

</div>

I'd use for now the official Java client (note that you have to upgrade it only when you switch to a new major version: 1.x -\> 2.x -\> 5.x

We will hopefully provide a REST client for 5.0 so I would not build my own for now.

My 2 cents.

---

<div class="post-metadata">

**Author:** ![hariso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hariso/32/50668_2.png) [@hariso](https://discuss.elastic.co/u/hariso)\
**Post date:** [April 12, 2016, 11:28am UTC](https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756/3 "2016-04-12T11:28:44Z")

</div>

Thanks a lot, David! I was not aware of the plan to have a REST client in 5.0.0, so that is awesome. I started with Jest, which you are probably already aware of. The official client is definitely great news.

---

<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 5, 2017, 11:00pm UTC](https://discuss.elastic.co/t/are-there-any-advantages-when-using-the-rest-api-in-a-jvm-app/45756/4 "2017-07-05T23:00:12Z")

</div>


