Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to safely update a live website

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:

  1. User opens a web form
  2. Site is updated to require new field on this form
  3. User submits the form they have been working on
  4. 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?

like image 300
gerdemb Avatar asked Mar 10 '09 13:03

gerdemb


People also ask

How do I change an already hosted website?

The two most common ways of updating your website are by: creating and editing webpages on your computer and then transferring them to the GreenNet webserver using FTP or. submitting new content for your website through an online web form that you access using a content management system.

How hard is it to update a website?

Still, updating content can be a difficult process for some business owners. Many web design companies build websites that make it complicated to change content. They require the customer to learn a complex array of shortcodes or pay a monthly fee for a set number of updates and changes.


1 Answers

Changes to a published API (or UI, in this case) is always tricky. If possible, preserve backwards compatibility. For most forms, I would reckon that the functionality wouldn't change between versions. You might add or remove a field or two, but that would be handled by the form validation on the backend. That's essentially what you're describing in your step 4. I don't really consider that much of a problem; Runtime errors happen from time to other - As long as your application handles it gracefully and informs the user of the problem, then no issue really.

like image 155
troelskn Avatar answered Nov 09 '22 09:11

troelskn