AWS OpenSearch Serverless

Just wondering if this is on the radar for consideration? AWS says something like this:

“Most tools that work with OpenSearch also work with OpenSearch Serverless. You don’t have to rewrite existing pipelines and applications. OpenSearch Serverless has the same logical data model and query engine of OpenSearch, so you can use the same ingest and query APIs you are familiar with, and use serverless OpenSearch Dashboards for interactive data analysis and visualization. Because of its compatible interface, OpenSearch Serverless also supports the existing rich OpenSearch ecosystem of high-level clients and streaming ingestion pipelines”

And based on this:

Just wondering how far off is hibernate search from being compatible to this? … Thanks


From what I understand this is just a provisioning option in Amazon OpenSearch Service, one that should be transparent to users.

Hibernate Search is already compatible with OpenSearch since Hibernate Search 6.1, and has a dedicated module to cope with the specifics of Amazon services. So if the APIs of Amazon OpenSearch Serverless really are the same as those of “classic” Amazon OpenSearch Service, then Hibernate Search should already work with this.

That being said, this “serverless” option is primarily aimed at short-lived applications. For such applications, you will probably want to take some precautions to disable a few things in Hibernate Search, in particular schema management on startup (manage it manually instead) and version check on startup.

One thing to note for “serverless” applications, but only if you use outbox-polling coordination (which is opt-in, but can be useful for highly scalable applications). If you scale your applications down to 0, background processing of indexing events will stop, and may not have processed all events when it stops. Maybe you could make it work by inserting some custom check in your scale-down mechanics to only scale down when there are no longer any events to process. Or just by having a long enough delay before scaling down to 0, so that you’re reasonably certain all events have been processed before your application scales down. But whether you can do that at all depends on your particular setup.

If anyone looking to build Java application using OpenSearch and not using Hibernate, check this articles. Lot of Java code examples to connect to OpenSearch (including serverless) & doing CRUD operations.

Hi @yrodiere, I am just trying out to connect Hibernate Search to AWS OpenSearch Serverless. I think it is more than just a provisioning option. It seems that modifications in hibernate-search-backend-elasticsearch-aws are needed since the signed service “es” is hardcoded. And just replacing it by “aoss” (Amazon OpenSearch Serverless) does not solve the problem…

It would be awesome if

  • it will be solved within hibernate-search-backend-elasticsearch-aws natively
  • there are workarounds for this authentication problem

I didn’t mention that, I was talking about adding an option to Hibernate Search. I understand the problem is that the service is hardcoded. Until now that was the only relevant value, so… :slight_smile:

Yes, please open an issue on Jira.

Not that I know. Thought I guess you can copy/paste the code of hibernate-search-backend-elasticsearch-aws into your project and make the necessary changes, if your project complies with Hibernate Search’s source code license.

Ah, sorry, it seems I confused this thread with another one on stackoverflow (Hibernate Search AWS OpenSearch Serverless connection problem - Stack Overflow).

Anyway, my point remains: please open an issue on Jira about the service being hardcoded to “es”.

For the record, here’s the Jira issue:

[HSEARCH-4867] - Hibernate JIRA