We have a fairly simple Django-based website for doing CRUD operations. I've been doing testing and development locally and then checking out releases and database schema changes onto the live server once testing is done. We've recently run into a problem when releasing some types of changes. Imagine the following sequence of events:
- User opens a web form
- Site is updated to require new field on this form
- User submits the form they have been working on
- Server returns an error because it expected to receive the new field that was added in step 2
How do other sites handle these kinds of problems? My ideas:
- Take the site offline while updates are being made. This doesn't really solve the problem, because a user could have a web form open for an infinite amount of time before submitting it, but after a certain amount of time it would be unlikely that anyone would be submitting the form.
- Do automatic updates at very low traffic times. Again this doesn't really solve the problem, but our site isn't that popular and if we did an update at 3:00a I doubt there would be many users. One concern with this technique is automatic updates that fail.
- Versioning forms so that the server recognizes that an old form is being submitted and provides a more user friendly response. Are there automated tools that could help with this?
Thoughts?