Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Matthew A. Titmus

Rating No ratings yet

Learn how to use Go's strengths to develop services that are scalable and resilient even in an unpredictable environment. With this book's expanded second edition, Go developers will explore the composition and construction of cloud native applications, from lower-level Go features and mid-level patterns to high-level architectural considerations. Each chapter in this new edition builds on the lessons of the previous chapter, taking intermediate to advanced developers through Go to construct a simple but fully featured distributed key-value store. You'll learn about Go generics, dependability and reliability, memory leaks, and message-oriented middleware. New chapters on security and distributed state delve into critical aspects of developing secure distributed cloud native applications. With this book you will • Learn the features that make Go an ideal language for building cloud native software • Understand how Go solves the challenges of designing scalable distributed services • Design and implement a reliable cloud native service by leveraging Go's lower-level features such as channels and goroutines • Apply patterns, abstractions, and tooling to effectively build and manage complex distributed systems • Overcome stumbling blocks when using Go to build and manage a cloud native service

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide for intermediate Go developers who want to build distributed services that stay reliable when the infrastructure underneath them does not. It walks you from Go's language fundamentals up through concurrency patterns and cloud-native architecture, using a single distributed key-value store as the running project. 【Book Arc】 - **Opening (~0%–10%)**: Frames what "cloud native" actually means — scalability, loose coupling, resilience, manageability, observability — and argues why Go's design (static typing, static linking, composition over inheritance) fits that world. Solves the "why this language, why this architecture" question before any code. - **Early (~10%–30%)**: Lays the Go language foundation: pointers, control structures, error handling, variadic functions and closures, structs/methods/interfaces, type embedding, and generics. Solves the problem of readers coming from other languages needing a shared vocabulary before patterns make sense. - **Early–Middle (~30%–45%)**: Introduces concurrency as "the good stuff" — goroutines, channels (buffered, closing, ranging), `select`, and `context.Context` for cancellation and timeouts. Solves the core problem of coordinating concurrent work safely. - **Middle (~45%–60%)**: Moves into cloud-native concurrency patterns: timeout wrappers, Future, Fan-In, Chord, and related composition techniques built from channels, `sync.Once`, and `sync.WaitGroup`. Solves the problem of turning primitives into reusable, testable abstractions. - **Late (~60%–85%)**: Shifts to higher-level architectural concerns — scalability, state, redundancy, dependability and reliability, memory leaks, message-oriented middleware, security, and distributed state. Solves the problem of making a working service survive real, unreliable environments. - **Ending (~85%–100%)**: Consolidates everything into the running distributed key-value store, applying the lower-level features, mid-level patterns, and architectural decisions together. Solves the "how does this all fit into one system" problem. 【Key Takeaways】 - **Cloud native is a system property, not a deployment target** (Opening): scalability, loose coupling, resilience, manageability, and observability are design goals you build toward, not things you bolt on later. - **Go was designed for the cloud-native era** (Early): its deliberate omissions (no inheritance, minimal feature creep) and inclusions (composition, structural typing, fast builds) reduce the cognitive load of building server software. - **Explicit types act as documentation** (Early): Go's type system tracks information the programmer would otherwise hold in their head, easing maintenance across teams. - **Concurrency primitives compose into patterns** (Early–Middle): goroutines, channels, `select`, and `context` are the raw material; timeout wrappers, Future, Fan-In, and Chord are the reusable shapes built from them. - **Context is for cancellation, not for carrying values** (Middle): the book deliberately avoids `context.WithValue` in its examples and warns that stuffing values into contexts obscures program flow and breaks compile-time coupling. - **Reliability requires deliberate handling of failure** (Late): timeouts, cancellation, redundancy, and dependability are treated as first-class design concerns, not edge cases. - **Memory leaks are a real risk in long-lived services** (Late): the book calls them out explicitly as a stumbling block when managing cloud-native services. - **Security and distributed state are new second-edition priorities** (Late): dedicated chapters treat them as critical aspects of secure distributed applications rather than afterthoughts. 【Reading Tips】 - **Skim the language foundations if you already write Go daily.** The early chapters on pointers, control structures, and interfaces are refreshers; deep-read the generics and type-embedding sections if those are new to you. - **Deep-read the concurrency and patterns chapters.** This is where the book's value concentrates — the timeout, Future, Fan-In, and Chord patterns are the transferable material you'll reuse in your own services. - **Follow the key-value store project across chapters.** Each chapter builds on the last, so reading out of order will cost you the cumulative context the author intends. - **Treat the late chapters as design checklists.** When you're about to ship a service, revisit the material on reliability, memory leaks, security, and distributed state as a pre-flight review. - **Use the companion code repository alongside the text.** The examples are meant to be run and modified, not just read. 【Coverage Limits】 The excerpts cover the book's framing, Go language foundations, concurrency primitives, and several concurrency patterns in reasonable detail, but the later chapters on security, distributed state, and the final key-value store implementation are only referenced, not shown. Specific claims about those chapters' contents are drawn from the book's own description rather than from excerpted text.
Page 10
Native Go Constructs 3. Go Language Foundations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Basic D...
View in text
Excerpt 2
lowing its users to focus on solving their problems instead of struggling with their language. The result, the Go language, is notable as much for the featur...
View in text
Excerpt 3
surrounding function returns and is commonly used to guar‐ antee that resources are released or otherwise cleaned up. For example, to defer printing the text...
View in text
Excerpt 4
cached values. Note the use of sync.Once and sync.WaitGroup. The former does what it says on the tin: it ensures that the function that’s passed to it is cal...
View in text
Excerpt 5
t in code. But what about the FileTransactionLogger itself? The service will want to keep track of the physical location of the transaction log, so it makes...
View in text
Excerpt 6
he was referencing Hoare’s work in structured programming. 3 Tony Hoare, “Null References: The Billion Dollar Mistake”, InfoQ.com, August 25, 2009. 181 Fault...
View in text
Excerpt 7
at the same functionality implemented using Go channels. In this example, Resource has been reduced to its essential component (the URL string), and Poller i...
View in text
Excerpt 8
e information about http.Client and its available settings. Remote procedure calls with gRPC gRPC is an efficient, polyglot data exchange framework that was...
View in text
Tags
AI categories
GoCloud NativeBackend
ISBN: 1098156420
Publisher: O'Reilly Media
Publish Year: 2024
Language: English
Pages: 542
File Format: PDF
File Size: 6.6 MB
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.

Generating text preview…