On the other hand if anything goes wrong during the rollout you can change the

On the other hand if anything goes wrong during the

This preview shows page 461 - 463 out of 517 pages.

can deploy a new migration and code push that eliminate the old code paths and old schema. On the other hand, if anything goes wrong during the rollout, you can change the feature flag’s value back in order to continue using the old schema and code until you determine what went wrong. Deployed apps always move forward: if something goes wrong, fix it with another up-migration that undoes the damage rather than trying to apply a down-migration that hasn’t been tested in production and may make things worse if applied. ELABORATION: Other uses for feature flags Besides handling destructive migrations, feature flags have other uses as well: Preflight checking: roll out a feature to a small percentage of users only, in order to make sure the feature doesn’t break anything or have a negative effect on overall site performance. A/B testing: roll out two different versions of a feature to two different sets of users to see which version most improves user retention, purchases, and so on. Complex feature: sometimes the complete functionality associated with a feature may require multiple incremental deployment cycles such as the one described above. In this case, a separate feature flag can be used to keep the feature hidden from the user interface until 100% of the new feature code has been deployed. The rollout gem supports the use of feature flags for all these cases.
Image of page 461
Self-Check 12.4.1. Which of the following are appropriate places to store the value of a simple Boolean feature flag and why: (a) a YAML file in the app’s config directory, (b) a column in an existing database table, (c) a separate database table? The point of a feature flag is to allow its value to be changed at runtime without modifying the app. Therefore (a) is a poor choice because a YAML file cannot be changed without touching the production servers while the app is running. 12.5 Quantifying Availability The best performance improvement is the transition from the nonworking state to the working state. John Ousterhout, designer of magic and Tcl/Tk As we learned in Chapter 1 , availability refers to the fraction of time your site is available and working correctly. For example, Google Apps guarantees its enterprise customers a minimum of “three nines” or 99.9% availability, though Nygard wryly notes ( Nygard 2007 ) that less-disciplined sites provide closer to “two eights” (88.0%). Overprovisioning not only helps with latency, as mentioned above, but it also lets you deal gracefully with server crashes: temporarily losing one server degrades performance by 1⁄n, so an easy solution is to overprovision by deploying n + 1 servers. However, at large scale, systematic overprovisioning is infeasible: services using 1,000 computers cannot readily afford to keep 200 additional servers turned on just for overprovisioning. One way to improve the reliability of software is to make it more robust. Defensive programming is a philosophy that tries to anticipate potential software flaws and write code to handle them. Here are three examples: Check input values. A common cause of problems is for the user to input values that the developer doesn’t expect. Checking that the input is in a reasonable range for individual values, that it is not
Image of page 462
Image of page 463

You've reached the end of your free preview.

Want to read all 517 pages?

  • Spring '19
  • Dr.Marcos

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors