javaelasticsearchmigrationliquibaseflyway

Liquibase or Flyway database migration alternative for Elasticsearch


I am pretty new to ES. I have been trying to search for a db migration tool for long and I could not find one. I am wondering if anyone could help to point me to the right direction.

I would be using Elasticsearch as a primary datastore in my project. I would like to version all mapping and configuration changes / data import / data upgrades scripts which I run as I develop new modules in my project.

In the past I used database versioning tools like Flyway or Liquibase.

Are there any frameworks / scripts or methods I could use with ES to achieve something similar ?

Does anyone have any experience doing this by hand using scripts and run migration scripts at least upgrade scripts.

Thanks in advance!


Solution

  • From this point of view/need, ES have a huge limitations:

    What does that mean in context of your question? You, basically, can't have classic migration tools for ES. And here's what can make your work with ES easier:


    So, a little bit of experience. For me, currently reasonable flow is this:

    Every time code being deployed, you

    1. Try to put model(type) mapping. If it's done w/o error, this means that you've either

    All of this actually means that you're good to go with mappping/data you have, just work with data as always.

    1. If ES provide exception about new mapping, you

    This is production-tested solution. Caveats around such approach:


    To sum up this: