3

We have an asp.net/MVC2 web app hosted on Amazon windows IIS7 that I would like to deploy updates to with as little downtime as possible.

Building on IIS ARR 3-site setup as described here Zero downtime uploads / Rollback in IIS I would like to come up with a way to deploy my database updates (MySQL on Amazon RDS) in a way that minimizes or eliminates downtime.

Is anyone doing anything like this? The app must be deployed against a db of the right schema version and we have a system that manages those changes during a rollout.

I can imagine using ARR to gracefully drain the live site and bring up the newly-provisioned site while simultaneously running the db migrations and having the new app hold processing of web requests until the db changes were done but that seems very hard to coordinate timing on and even harder to test, not to mention the issue of client timeouts if the process takes longer than the browser wants to wait.

Thanks!

1 Answers1

1

Nobody has a great answer for this. You have to make backwards-compatible schema changes, however hard that may be.

Typically this means that your app can't just depend on one schema version, but needs to be able to support multiple schemas during the transition. (Your transactions should update both schemas, etc.)

Note that even NoSQL schema-less datastores don't solve this problem, but rather require you to solve it, in much the same way: if you have a key with N values, and you need to add a new value, your app needs to deal with the possibility that the key might not be updated yet.

Good luck!

Dan Fabulich
  • 477
  • 1
  • 6
  • 17
  • Dan, I am desperately looking for solutions of the same problem. In the past 4 years, have you found more about a possible solution? In particular, I am not sure I understand this from your answer: `"if you have a key with N values, and you need to add a new value, your app needs to deal with the possibility that the key might not be updated yet."` Isn't it possible/realistic that the code of the new version knows how to serve old-version requests using only the new (and unchanged old) tables ? This would allow to use only one write/update and only in one (the upgraded) table. – Dimitre Novatchev Jul 26 '15 at 23:22