Initialization options and APIs

Description

We should:

  1. Move the schema initialization setting such as the "lifecycle.strategy" from Elasticsearch to the mapper

  2. Expose an API to control the initialization programmatically, with more options such as reindexing.

Because:

  1. Executing initialization on startup is not always a valid option, especially when multiple instances of the applications are deployed, or when Elasticsearch may not be reachable on startup (containers). So we need an API.

  2. Schema initialization is almost always followed by reindexing, which can only be done at the mapper level. So it would be nice to have both in the same API.

  3. For near-zero-downtime indexing, we will have to be able to temporarily create separate indexes and perform reindexing on these. So it will be necessary to mix the initialization API and mass indexing API.

  4. In the future, we may have to take extra steps at the mapper level when initializing the application, for example dropping or creating Debezium connectors. This can only be handled at the mapper level.

The configuration options would probably be something like this:

As to the API, I would imagine something like this:

Or for near-zero-downtime indexing:

Related to:

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Fix versions

Priority

Critical
Configure