While pondering over it: a lot of this could for instance happen in the deploy scripts, and perhaps execute a custom deploy script for this particular deploy.
While pondering over it: a lot of this could for instance happen in the deploy scripts, and perhaps execute a custom deploy script for this particular deploy.However, this is a multitenant web application, and things might need to happen for each tenant. So while running from the deploy script, preferebly this should run in a context where the tenants are known.
We have a Database Migration that upgrades the database to add a column Email Address, and a column Notes to the Client table. Both will be populated with data for all records during the migration.
The Email Address also needs to be indexed in ElasticSearch/Lucene/Solr/..., but the Notes column does not need to be indexed.Since there is existing data, the indexing step needs to happen in conjunction with the migration.
We cannot simply reindex completely after each migration or group of migrations. But, we do need to instruct the system to reindex, because of this migration.So, there is another "migration" step, which does not affect the database, but another part of the application.
We have a Database Migration that upgrades the database to add a column Email Address, and a column Notes to the Client table. Both will be populated with data for all records during the migration.What data? Where does it come from? How is it different from the existing data you mention below?
The Email Address also needs to be indexed in ElasticSearch/Lucene/Solr/..., but the Notes column does not need to be indexed.Since there is existing data, the indexing step needs to happen in conjunction with the migration.We cannot simply reindex completely after each migration or group of migrations. But, we do need to instruct the system to reindex, because of this migration.So, there is another "migration" step, which does not affect the database, but another part of the application.Is this just triggering the application to rebuild its indices? That sounds like a normal thing to have in your deployment cycle. For example, for a fairly basic deployment process (which assumes the app needs to be stopped during upgrade):
1) Distribute new app binaries to servers3) Put up holding page / disable monitoring3) Stop app instances4) Swap new app binaries into place5) Run database restructuring script6) Start app instances7) Smoke test app instances8) Trigger reindexing9) Remove holding page / enable monitoringSo where does your process need to differ from this?
Kief
On Wednesday, October 8, 2014 10:03:07 AM UTC+2, Kief Morris wrote:We have a Database Migration that upgrades the database to add a column Email Address, and a column Notes to the Client table. Both will be populated with data for all records during the migration.What data? Where does it come from? How is it different from the existing data you mention below?Maybe transformed data from existing data store, or CSV file? Does it matter? It is different because it is not already in the same datastore. So, the migration is: We add the field and want it populated.
We cannot simply reindex completely after each migration or group of migrations. But, we do need to instruct the system to reindex, because of this migration.So, there is another "migration" step, which does not affect the database, but another part of the application.Is this just triggering the application to rebuild its indices? That sounds like a normal thing to have in your deployment cycle. For example, for a fairly basic deployment process (which assumes the app needs to be stopped during upgrade):OK, I was not aware that this is a usual approach to do a full reindex upon deploy. What if a full reindex is discouraged? How to approach this problem in that case?