Cloud Native Development with Google Cloud (Daniel Vaughan)(Z-Library)

Author: Daniel Vaughan

其他

Cloud native development gives you the power to rapidly build, secure, and scale software. But you still need to navigate many potential pitfalls along the way. Through practical examples, this book demonstrates how to use Google Cloud as a laboratory to enable rapid innovation, a factory to automate build and testing, and a citadel to operate applications at scale securely. Author Daniel Vaughan shows you how to take applications from prototype to production by combining Google Cloud services, a cloud native programming model, and best practices. By following an example project from start to finish, developers, architects, and engineering managers working with the Google Cloud Platform will learn how to build and run cloud native applications on Google Cloud with confidence. With this book, you will: Understand cloud native development concepts including microservices, containerization, and event-driven architecture Learn Google Cloud servicesthat specifically support this development style: compute, persistence, messaging, DevOps, security and networking, and observability Confidently build cloud native applications on Google Cloud Learn how to address nonfunctional requirements such as security, observability, and testing Successfully make the transition from initial proofs of concept and prototypes to production systems

📄 File Format: PDF
💾 File Size: 4.5 MB
6
Views
0
Downloads
0.00
Total Donations

📄 Text Preview (First 20 pages)

ℹ️

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

📄 Page 1
(This page has no text content)
📄 Page 2
Cloud Native Development with Google Cloud Building Applications at Speed and Scale Daniel Vaughan
📄 Page 3
Cloud Native Development with Google Cloud by Daniel Vaughan Copyright © 2024 Daniel Vaughan. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Megan Laddusaw Development Editor: Sara Hunter Production Editor: Beth Kelly Copyeditor: nSight, Inc. Proofreader: Brandon Hashemi Indexer: Potomac Indexing, LLC Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Kate Dullea November 2023: First Edition Revision History for the First Edition
📄 Page 4
2023-11-10: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781098145088 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Cloud Native Development with Google Cloud, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the author and do not represent the publisher’s views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. 978-1-098-14508-8 [LSI]
📄 Page 5
Preface Many organizations have faced disappointment with cloud migration when expected productivity gains and cost savings weren’t realized. Often, the mistake is treating the cloud as just another data center. This book highlights the distinctiveness of a cloud native approach and how it can truly harness the power of the cloud.
📄 Page 6
Who This Book Is For This guide is for software developers and architects who are either newcomers to cloud computing or already on their cloud journey and want a deeper understanding of Google Cloud. While Google offers numerous professional certifications for its cloud platform, they can be rather theoretical. This book bridges that gap, offering a holistic view of Google Cloud services and how they come together to create a powerful toolkit for cloud native application development. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values determined by context. TIP This element signifies a tip or suggestion.
📄 Page 7
NOTE This element signifies a general note.
📄 Page 8
How This Book Is Organized This book is organized into four distinct parts, each serving a different purpose. Part I lays the groundwork by introducing cloud native development, Google Cloud, and the fundamental concepts of cloud native applications. Part II is a hands-on guide, designed to help you get building with Google Cloud. After preparing your Google Cloud environment, you will work through five projects that form the building blocks of an example application, becoming acquainted with essential Google Cloud services and gaining practical experience. Part III delves into the “facilities” you can build with Google Cloud to streamline the development and management of your applications. It introduces techniques and tools to enhance your efficiency and make your life easier. Part IV of the book serves as a gateway for the next phase of your cloud journey. It first gives you ideas of how to scale the example application using the more advanced Google Cloud services and then offers information, tips, and resources to help you explore further and continue your learning. Using Code Examples The code that accompanies this book, Skills Mapper, is available in a single project on GitHub at https://github.com/SkillsMapper/skillsmapper. At the beginning of each chapter that uses code, the directory within the project will be indicated. If you have a technical question or a problem using the code examples, please send email to bookquestions@oreilly.com. This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re
📄 Page 9
reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Cloud Native Development with Google Cloud by Daniel Vaughan (O’Reilly). Copyright 2024 Daniel Vaughan, 978-1-098-14508-8.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. O’Reilly Online Learning NOTE For more than 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit https://oreilly.com. How to Contact Us
📄 Page 10
Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-889-8969 (in the United States or Canada) 707-829-7019 (international or local) 707-829-0104 (fax) support@oreilly.com https://www.oreilly.com/about/contact.html We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at https://oreil.ly/cloud- native-dev-with-GC. For news and information about our books and courses, visit https://oreilly.com. Find us on LinkedIn: https://linkedin.com/company/oreilly-media Follow us on Twitter: https://twitter.com/oreillymedia Watch us on YouTube: https://youtube.com/oreillymedia Acknowledgments This book is lovingly dedicated to my wife, Michelle, who has been as supportive as ever on this journey. My gratitude goes to the wonderful team at O’Reilly for bringing my ideas to fruition. A special note of thanks to the
📄 Page 11
astute technical reviewers Shreya Chakravarty, Pankaj Gajjar, Michael Hopkins, Nodir Siddikov, and Wietse Venema; your insights have been instrumental. To my friends, colleagues, and well-wishers, I am deeply appreciative of your encouragement. Most of this book was written during early morning and early evening sessions at Starbucks in Saffron Walden, UK, where I was often the first customer to arrive or the last to leave. I’m grateful to the staff for their patience and for keeping me well-caffeinated. On many such occasions, my baby son Alex was my silent partner. While he might not have contributed in words, his companionship was inspirational.
📄 Page 12
Part I. Cloud Native Google Cloud In this part, you’ll discover the origins of cloud and cloud native applications and understand why Google Cloud is an excellent platform for them.
📄 Page 13
Chapter 1. Why Cloud Native and Not Just Cloud? In the late 1990s when I started my career, the digital landscape was in the early stages of transformation. Companies were introducing email servers for the first time as employees began to familiarize themselves with PCs sitting on their desks. As the hands-on tech guy, my job was to set up these PCs and install email servers in server rooms, connecting them to the internet through dial-up modems or ISDN lines. Back then, a computer room was often just an air-conditioned cupboard that housed the company’s entire computing infrastructure. I distinctly remember installing a server next to a washing machine–sized DEC VAX, a computing relic from the 1980s, which continued to run just as it was pictured in my computer science textbooks. With the dot-com boom of the early 2000s, a robust and uninterrupted internet presence became critical for businesses. Large corporations responded by investing in on-premises data centers, specialized facilities equipped to host IT equipment with multiple redundant internet connections and power supplies. However, building a dedicated data center wasn’t feasible for smaller companies. Instead, they could rent space in shared colocation data centers, or “CoLos.” But this posed a significant challenge for emerging internet startups: What happens if you become an overnight success? What if your user base explodes from a thousand to a million users overnight? Would it be wiser to start with servers that can accommodate a thousand users and risk your website crashing if you can’t scale quickly enough? Or should you preemptively invest in the capacity to serve millions of users, in the event of rapid growth? The latter choice would require significant funding, possibly reliant on a venture capitalist with deep pockets.
📄 Page 14
Balancing this risk and potential growth became a pressing question for many businesses during this time. Emergence of the Cloud Era The advent of the public cloud marked a significant turning point. Launched in 2006, Amazon Web Services (AWS) began offering on- demand EC2 servers, and by 2008, anyone with a credit card could virtually set up a server in an instant. The ability to seamlessly scale up server capacity as demand increased was a game changer. Startups could begin with modest infrastructure and then expand as they became more profitable, thus minimizing initial investments and reducing the cost of innovation. In 2008, Google followed suit with the Google App Engine (GAE), pioneering one of the first platforms as a service (PaaS). With GAE, developers could write a web application in PHP or Python and deploy it on Google’s public cloud, all without the need to manage server infrastructure. Despite GAE’s potential, it presented challenges for developers like me, accustomed to working with traditional applications and relational databases, due to its unfamiliar restrictions. As the 2010s unfolded and cloud computing surged in popularity, companies with pricey on-premises data centers began eyeing their digital native competitors with envy. Companies like Netflix, Airbnb, and Slack. These newer entities, born in the cloud and deploying software on platforms like AWS, Google Cloud, and Microsoft Azure, were rapidly releasing competitive products without bearing the burdensome costs of maintaining a data center. They were also leveraging additional on-demand cloud services, including machine learning and AI, which offered unprecedented capabilities. Established companies, rooted in traditional data center operations, found the allure of the cloud irresistible for several reasons, as shown in Figure 1- 1.
📄 Page 15
Figure 1-1. Go faster, save money, and do more These were typically: Go faster Enhance developer productivity by leveraging the cloud’s on-demand, scalable resources and a wide range of prebuilt services. This allows developers to focus on core application logic instead of infrastructure management. Save money Decrease infrastructure or operational costs by shifting from capital expenditure (CapEx) for hardware and maintenance to operational expenditure (OpEx) for on-demand services, improving cash flow and reducing upfront investments. Do more Access resources and services that are impractical in an on-premises setup, such as vast scalable storage options, powerful data analytics tools, machine learning platforms, and advanced AI services. The critical misstep these organizations often make is migrating to the cloud without understanding its unique nature, the added complexity, and how it necessitates changes in software development practices. As a result,
📄 Page 16
rather than enhancing efficiency and reducing costs, the cloud can sometimes introduce additional complications and expenses, thus slowing progress and increasing expenditure. Therefore, the frequently promised benefit of “run your mess for less” rarely materializes, underscoring the importance of a well-informed and strategic approach to cloud migration. Navigating the Cloud Migration I am a great admirer of Marie Kondo, the Japanese organizing consultant who brings joy to homes by transforming cluttered spaces into realms of tranquility and efficiency. Picture a cupboard brimming with two decades of accumulated possessions —a mix of obsolete, broken, and unopened items. Among these are items you’ve bought in duplicate, unaware of their existence deep within the cluttered confines. Amid the chaos, a few handy objects await discovery. However, trying to excavate them could cause a catastrophic avalanche. Trust me, I possess such a cupboard. This scenario aptly represents a typical on-premises data center, a labyrinth of applications without discernment of their significance. In the quest for cloud benefits, companies were urged to execute a “lift and shift” strategy—moving their existing applications to the cloud wholesale. This strategy often feels akin to relocating your cluttered cupboard into a rented garage in another part of town. You still grapple with the same amount of stuff; it’s just more inconvenient to access and secure. Not to mention, the garage comes with an additional rental cost. An alternative to “lift and shift,” companies were also recommended to “containerize” their applications before cloud migration. Using the cupboard analogy, this would equate to packing your belongings into plastic crates before moving them to the garage. Containerization simplifies the transportation and management of applications and facilitates future moves between different storage units. Nonetheless, it inherits the downsides of garage storage, along with the added expense of containers. This “move and
📄 Page 17
improve” strategy seems appealing, but the motivation to sort out the clutter often dwindles once it’s out of sight. The Pitfalls of an Unplanned Journey The ideal scenario involves decluttering the cupboard entirely. Broken items should be repaired or discarded, obsolete belongings removed, and duplicated or unused possessions donated. Following Marie Kondo’s mantra, you should retain only the items that “spark joy.” Once this selection is complete, you can consider whether to display these cherished items prominently or store them away, neatly and securely. In the realm of cloud technology, this approach translates into cloud modernization: a comprehensive review and restructuring of applications for optimal cloud performance. This topic, however, lies beyond the scope of this book. As many companies have discovered, cloud modernization can be a lengthy and costly process. Many firms have resorted to the lift and shift or containerization strategies, only to find their applications harder to manage and secure and more expensive to run in the cloud. Less than optimal experiences with cloud migration have resulted in scepticism and disappointment surrounding the cloud. Companies have been reminded that there is no one-size-fits-all solution or quick fix. Despite this disillusionment, digital native competitors continue to leverage the cloud’s advantages, warranting a deeper exploration into what sets these companies apart in their cloud strategy. More Than Just an Online Data Center Digital natives understand that the real power of public cloud services lies in their massive, globally distributed, shared, and highly automated data centers. These features enable the provision of pay-per-use billing, virtually limitless scalability, and a self-service consumption model, as shown in Figure 1-2.
📄 Page 18
Figure 1-2. Cloud benefits Nevertheless, public clouds are constructed from commodity hardware connected by networks that have been selected to minimize the total cost of ownership. The hardware is managed by a third-party provider and shared among multiple clients. It’s crucial to understand that cloud computing isn’t inherently more reliable, cost-effective, or secure than running your own data center: Data center hardware is often built for redundancy and task-specific optimization, while in the cloud, hardware is generic, commoditized, and designed with the expectation of occasional failure. In a data center, you own the hardware and change is difficult. In contrast, the cloud provides rented hardware on a minute-to-minute basis, allowing for easy change, but at a premium over your hardware. A physical data center has an effective wall around it, engendering a level of implicit trust in the infrastructure inside. In the cloud, however, a trust nothing approach should be adopted. Transitioning to the cloud isn’t simply a matter of transferring your traditional data center operations online. It represents an opportunity to leverage a powerful technology that can fundamentally reshape business operations. However, this requires the correct approach. Simply replicating your on-premises setup in the cloud without adapting your methods can lead to higher costs, heightened security risks, and potentially reduced
📄 Page 19
reliability, as shown in Figure 1-3. This fails to utilize the full potential of the cloud and can be counterproductive. Figure 1-3. The reality of treating cloud as another data center Instead, acknowledging the unique characteristics and requirements of the cloud and fully embracing these can be truly transformative. Harnessing the elasticity, scalability, and advanced security features of the cloud can lead to levels of operational efficiency, cost-effectiveness, and innovation that surpass what traditional data center environments can offer. The cloud isn’t just an online variant of your current data center. It’s a different paradigm that demands a different approach. When navigated adeptly, it can unlock a world of opportunities far surpassing those offered by traditional infrastructure. Embrace the differences, and the cloud’s full potential is vast. Embracing the Cloud as a Distributed System The essential truth of the cloud is that it functions as a distributed system. This key characteristic renders many assumptions inherent in traditional development obsolete. These misconceptions, dubbed the fallacies of distributed computing, were first identified by L Peter Deutsch and colleagues at Sun Microsystems:
📄 Page 20
The network is reliable. Latency is zero. Bandwidth is infinite. The network is secure. Topology doesn’t change. There is one administrator. Transport cost is zero. The network is homogeneous. Each of these points represents a hurdle that must be surmounted when attempting to construct a cloud from scratch. Thankfully, cloud providers have devoted substantial engineering resources over the past two decades to build higher-level abstractions through APIs, effectively addressing these issues. This is precisely why digital natives have an edge—they are attuned to cloud native development, a methodology that leverages this groundwork. Cloud native development acknowledges the distinct characteristics of the cloud and capitalizes on the high-level abstractions provided by cloud provider APIs. It’s a development style in tune with the realities of the cloud, embracing its idiosyncrasies and leveraging them to their full potential. Distinguishing Cloud Hosted from Cloud Native Understanding the difference between cloud hosted and cloud native applications is fundamental. To put it simply, the former is about where, and the latter is about how.
The above is a preview of the first 20 pages. Register to read the complete e-book.

💝 Support Author

0.00
Total Amount (¥)
0
Donation Count

Login to support the author

Login Now

Recommended for You

Loading recommended books...
Failed to load, please try again later
Back to List