SQL Zone is brought to you in partnership with:

A passionate professional in areas of java performance, distributed systems and in-memory-data-grids. For the last 5 years I was working on various performance critical java systems (usually involving data grids) in areas of finance, telecom and ecommerce. See http://blog.ragozin.info for a list of my articles. Alexey is a DZone MVB and is not an employee of DZone and has posted 4 posts at DZone. You can read more from them at their website. View Full User Profile

Search Oracle Coherence grid with Lucene

  • submit to reddit

Traditionally full text search engines such as Apache Lucene/Solr are implemented as infrastructure separate from core application. Such "search as a black box" approach allows painless integration with a whole variety of application on variety of platforms. But some use cases require search functionally to be deeply integrated with application and blackboxed solution will just add unnecessary complexity.

In-memory-data-grids (IMDG) are often used for storing huge amount of documents in memory (with lightning fast access time). While most IMDG have own indexing/queering machinery, they do not provide such rich full text search features as Lucene do. It is possible to build separate search infrastructure to complement data grid (using Lucene or some enterprise search product), but now you have to maintain it, keep content of grid and search index in sync, which is doable but adds complexity.

While dedicated search infrastructure may add some value on top of full text search, in many cases ability to execute Lucene queries over sets of objects in data grid would be just enough.

And if your data grid is Oracle Coherence you may have this ability right now!

Coherence 3.6 has added ability to plug custom index engines into grid and Lucene integration package provides you with everything you need to plug Lucene in. Coherence grid itself will manage all life cycle of index for you, it will create index, populate it with objects, keep up to date and handle partitioning and recovery. And you do not need to maintain dedicated search infrastructure if you are using embed Lucene index with Coherence.

You may also be interested in Lucene even if you do not need full text search. For many complex queries Lucene is showing better performance compared to built-in Coherence indexes. You can find performance comparison between embedded Lucene and Coherence indexes in  this article.

Published at DZone with permission of Alexey Ragozin, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)