开发者

How do you handle patches / updates to PHP and Frameworks

Big discussions in the moment at our company. How to handle upd开发者_StackOverflowates to PHP and used PHP (Zend Framework) / JavaScript Frameworks like JQuery and Dojo.

Do you patch every php version? do you deploy every Framework update to production servers? I think it takes and huge amount of time to test all depencys? Or is fire & forget best practise?

Would love to hear your expirence in this field! Thanks.


First off, it's best to have a load balancer with multiple servers to process requests. That way if a deployment issue happens on one, you can pull it off the balancer and let the others handle it.

In regards to whether or not I would update said framework or PHP, the question comes down to:

  1. Does it break compatibility? - This is the most important factor. Even for critical security updates, you'll have to put your code on a staging server and work through all the issues.
  2. Is it a bug fix? Does the bug fix affect something I'm using? - If I don't use SOAP and there's a bug fix on SOAP code, I pass. Now if there's a bug in how arrays are handled, I will definitely upgrade.
  3. Is it a security fix? Does it affect something I'm using? - Same policy here, but I'll be quicker about the upgrades.

Now as far as how to handle it, I'd recommend the following:

  1. Take a node off the load balancer, make sure a copy of the previous source is available for if things go wrong.
  2. Update whatever you need to, then bring it back to the load balancer, but restrict it to an IP address that only you can see.
  3. Check that everything looks legit. If there's an issue bring it back down and see if the issue can be resolved, or if you need to put back the previous source.
  4. If it's an issue that can be resolved, resolve it then go back to step 2.
  5. Next, bring down another server from the load balancer and do the same.
  6. Do this until you have a nice 50/50 split between old version nodes and new version nodes.
  7. Now, force all user requests to go to the new version noes to make sure the public facing site is okay. If something fails, force the old version nodes back online.
  8. If everything is okay, upgrade the old version nodes and bring them back to the balancer when you're done.

How many nodes you need will depend on the scale of your site. Please note that this is somewhat of a more paranoid method for updates.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜