Pro Website Development and Operations: Streamlining Devops
Total Page:16
File Type:pdf, Size:1020Kb
For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance Foreword ................................................................................................ xi About the Author .................................................................................. xiii About the Technical Reviewer ............................................................... xv Acknowledgments ............................................................................... xvii ■ Chapter 1: DevOps Principles for Successful Web Sites .......................1 ■ Chapter 2: Aligning Engineering and Business Operations ................15 ■ Chapter 3: Web Testing Practices .......................................................27 ■ Chapter 4: Designing Intelligent Documentation ................................45 ■ Chapter 5: Automating Infrastructure and Application Provisioning .............................................................61 ■ Chapter 6: Production Launches ........................................................73 ■ Chapter 7: Mobile Web Integration .....................................................93 Index ....................................................................................................103 CHAPTER 1 DevOps Principles for Successful Web Sites Because this is a book about web development and operations, you need to know more than just how to build web sites. You also have to understand how teams within a company interact, and which best practices it’s important to follow. The interaction of software engineers and sys- tem administrators has given rise to the term developer operations or DevOps, because of the way these teams cross each other’s boundaries to work as a single logical unit. I thought this would be the best subject to start off with, because without some kind of union or partnership between these two groups (and others, for that matter), you aren’t going to get very far, particu- larly if you’re building a large, complex site. A healthy flow of information between web developers and operations engineers is crucial to establishing a solid foundation for any web site team. Most modern sites that have some advanced functionality are composed of different layers of complex software that may require different technical skills in each area of the Web stack—the layers of technology that make up a web site. That kind of complexity requires collaboration and interaction. Too often, however, engineers rely on computerized modes of communications, or they simply sit at their desks doing the same thing day in and day out. It’s important to encourage active collaboration between operations and development people. Toward that end, it’s a good idea to come up with a set of principles they can follow. Here are some guidelines that may help increase collaboration between software development and operations teams: 2 CHAPTER 1 | DEVOPS PRINCIPLES FOR SUCCESSFUL WEB SITES • Collaborate in person: Get out of your seat and talk to the other operations engineers or developers face to face. There is something you can’t get from an e-mail or a phone call that you can from in- person communication. Think of trying to have a party with friends over the phone. Okay, now go talk to someone about the next project, problem, or solution you have to deal with as a team. • Walk in their shoes: If you really get to know and understand the tools and daily processes of the software developers or operations engineers, you’ll be better equipped and more likely to find common ground for working better together. For example, if you’re an operations engineer and you haven’t taken the time to understand the source code management system, and the development folks are adamant about using git over Subversion, it pays to understand why they’ve taken this position. And it pays even further to learn such systems as much as time allows, because you’ll be able to better apply your skills to support these systems or help build tools and processes that support software development. • Work for each other: Make each other’s lives easier. Build tools for operations and operations will build tools for you. As Tom Limoncelli, author of Time Management for System Administrators (O’Reilly Media, 2005), said, “We are all programmers now.” Even so, we have complementary skill sets. In no way is everyone good at everything (although some folks might like to think so), so create a new tool that will help automate a process for your operations engineer or software developer. It doesn’t even have to be part of the production systems, and could even be a simple tool for the local desktop. This kind of “tool exchange” helps boost productivity, and it also strengthens bonds and enhances the collaboration efforts among teams. These essential principles apply both to companies with large development and opera- tions teams, and to small startups as well. They form the basis of this chapter and are the guid- ing rules underlying this book. The chapter also contains a number of interviews that will shine some light on the various roles of software developers and operations engineers to bring into focus the interaction between the two. A Closer Look at WebDevOps Operations has its roots in the industrial revolution where factories began to take on the bulk of the work in producing goods. Today, operations is the application of resources (capital, mate- rials, technology, and human skills and knowledge) to the production of both goods and ser- vices. Software development, on the other hand is more akin to the manufacturing process. Sysadmins and software engineers generally have been siloed in their respective departments instead of working as unit as was the case in traditional manufacturing. In an organization that does business online, the software development department builds applications to power some kind of consumer-facing or business-supporting web site or ser- vice. Meanwhile, the operations team monitors and maintains those applications, to keep them running and serving business functions. For the most part, Web developers and operations staff PRO WEBSITE DEVELOPMENT AND OPERATIONS 3 interact only during releases or when a problem arises that requires both groups to resolve. Today, however, as the number of web applications being developed continually increases and competitiveness among businesses requires that applications be immediately deployed into production for consumers (rather than into retail boxes as in the past), it’s more important than ever for both groups to share a common skill set. This has been happening since the creation of the Web. Tim Berners-Lee stated that when he created the Web, its main goal was to enhance communication through shared knowledge with collaboration as a driving force: “By building a hypertext Web, a group of people of what- ever size could easily express themselves, quickly acquire and convey knowledge, overcome misunderstandings, and reduce duplication of effort” (Weaving the Web, HarperCollins, 1999). The DevOps idea is rooted in these core principles to this day, but with a more focused empha- sis on developers and operations working together and using automation and tools to drive a cultural shift to produce and improve software at an intensified rate. 'The ideas mentioned throughout this book on how software developers and operations engineers can work better together can be applied throughout the entire organization. For example, most principles I outline in this book can also be applied to interactions between operations engineers and marketing, say, or between development and executive manage- ment or quality assurance. To keep things simple, I have focused primarily on the interactions between operations and software development teams. Since the advent of Agile software development, modern web applications are developed very rapidly in a process that iteratively designs and launches code, lets it fail, and then fixes it rapidly. Agile has stretched boundaries, causing system administration and other operations professionals to ramp up their abilities to troubleshoot application and code issues, working more closely with software development, and essentially becoming more like software engi- neers themselves. The days of just watching graphs and rebooting the occasional application or web server are over for the system administrator. Now applications are being built and tested continually to keep up with changing business trends, and the operations teams need to under- stand not only how to write code, but also how the code being passed to them from a develop- ment team works, and how it’s deployed and managed. Operations must be able to work closely with development to set up such processes, so that development, deployment, and manage- ment of web software are fluid. The developer and the operations engineer must be able to work at the same level, without relying on each other as much to accomplish the necessary tasks separately as in previous years, and they must work efficiently to avoid wasting time. The walls between development and operations have begun to come down as a matter of necessity. Today’s software is produced ever more quickly, with many large software orga- nizations releasing daily or even multiple times a day, and a majority releasing bi-weekly or weekly. Cultural changes usually take years, and web development is only about 30 years old. But a web development culture