asp.net mvc - Migrating EF Code First in multiple instances -


i have mvc app using ef6 code first. want deploy app multiple datacenters. on deployments have migrations, can write script migrate them simultaneously possible, if 1 datacenter slower, calls rejected since schema no longer matches. script tried coordinate make rolling upgrades impossible.

is there way make ef @ least attempt run query though schemas don't match? there different way can/should approach this?

update:

let's see if can word better. want have mvc app in multiple datacenters. let's assume deploy app each datacenter individually.

option 1

  1. deploy dc a
  2. code first migration runs on centralized db
  3. requests made dc succeed, requests dc b fail

option 2

  1. deploy dc a
  2. do not automatically run migration
  3. requests made dc fail , requests dc b continue succeed

how develop deployment strategy make requests either dc work?

btw: using azure web sites, if platform-specific solution needed.

in post, seemed concerned how behave during actual upgrade. nothing testing. in comments asking doing partial deployment doing testing. on 1 hand you'd want deploy possible minimize downtime. on other hand, sounds want deploy 1 site, test, , have other sites continue function while verifying first deployment?
verifying deployment reasonable, complex. i'm not sure find in way of automation this. i think should test prior production deployment thoroughly, , deploy possible in production. if there issue found when deploying production, you'd in bad situation, because site down until can fix it. if other instance work new database, risky going modifying things against schema doesn't understand. additionally, if need rollback ddl lose data modified since deployment. best instances old schema fail until upgraded, prevent them modifying data @ risk of being lost.

usually should have done deployment staging environment close production possible test database migration process. called pre-production testing, , involves restoring recent backup production staging ensure new constraints/structures valid existing data. deploying staging environment, should have high level of confidence production deployment go successfully.

you additionally safe guard against production deployment issues taking backups prior deployment can rollback necesary(although worst case scenario might mean throwing out important data came in between backup/deployment , realization there issue). imagine ef migrations uses transaction run ddl scripts should rollback all-or-nothing if there issue.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -