Why ElasticSearch was written in Java?

I am exploring other languages than Java. What I have learnt till date is that there is no silver bullet to solve each kind of use case and one needs to choose a language on the basis of what problem they are trying to solve .

What triggered this question were these two blog posts:

The first version of Elasticsearch was released in 2010, and there has to be a reason why Java was chosen for it.

Follow up question: What other language would be better performing for Elasticsearch if it was to be rewritten today? Would GoLang be a better choice than Java?

Hi Piyush,
Putting aside the pros and cons of Java as a language, a simplistic answer would be "because the core library on which elasticsearch depends (Lucene) is written in Java"

1 Like

Thanks for your reply Mark. One additional question, though I am not sure you will have an answer for me but I'll ask anyway, why the core library (Lucene) was written in Java? Wasn't C or C++ a better choice for such a core piece of software as C/C++ are closer to machine language as compared to Java?

1 Like

Doug Cutting was the original creator of Lucene (and later, Hadoop).
He said this of the decision to use Java for Hadoop:

"Java offers a good compromise between developer productivity and runtime performance. Developers benefit from a simple, powerful, type-safe language with a wide range of high quality libraries. Performance is generally good enough"

6 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.