Tracking active index version: alias or database? #1689
lukavdplas
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When we create an index for a corpus on a production server, we create numbered versions of the index, e.g.
ianalyzer-times-1
,ianalyzer-times-2
, etc. That way, we can keep the old version of an index around while working on a new one.To indicate which version is the active one, one index will be assigned an alias in Elasticsearch, e.g.
ianalyzer-times
, which matches theindex_name
configured for the corpus. I-analyzer will make a search request toianalyzer_times
, which will resolve to the index that has the alias.Using the alias for this essentially externalises the assignment from I-analyzer. It also means that multiple I-analyzer instances (e.g. a test/accept/production server, or servers for multiple projects) will synchronise which version of the index they're using.
The main advantage of synchronising the version selection through aliases is that it saves work. It can also prevent bugs or confusion from situations where the developer neglects to update the index version on all I-analyzer servers.
The disadvantage of this setup is that it prevents more complex version management. If you make an update to a corpus that is not backwards compatible, you'll have to roll out the change on all servers simultaneously. You can't try out the new index version on the test server before using it on the production server.
An alternative would be to store the active version somewhere in I-analyzer, i.e. in the project settings or the database (database seems preferable to me). This way, each instance can select the active version separately.
What do we think?
Beta Was this translation helpful? Give feedback.
All reactions