You are previewing Cloud Native Go: Building Web Applications and Microservices for the Cloud with Go and React.
O'Reilly logo
Cloud Native Go: Building Web Applications and Microservices for the Cloud with Go and React

Book Description

This is the Rough Cut version of the printed book.

Today, companies and developers need to respond to changing markets at breakneck speeds. Organizations that aren't built on highly-available, rapidly-evolving software are going the way of the dinosaurs. Cloud Native Go brings together the knowledge developers need to build massive-scale cloud applications that meet the insatiable demands of today's customers and markets.

Kevin Hoffman and Dan Nemeth start with a primer on Go, a programming language that's rapidly gaining traction due to its elegant simplicity, performance, and exceptional suitability for cloud development. Next, they describe the modern cloud-native application in detail, illuminating the 12 Factors associated with successful cloud-native development and the modern disciplines and habits that drive rapid and reliable cloud development.

Hoffman and Nemeth then guide you through building the skills you need to create microservices in Go, helping you master key techniques such as Test-Driven Development (TDD). Once you're comfortable building microservices, the authors show how to add front-end web components using ReactJS and Flux. They walk through Go-based, cloud-native techniques for request routing, RESTful service creation, Event Sourcing and CQRS, securing services, OAuth2 authentication, and much more.

You'll find practical techniques for working with web sockets at scale in the cloud, developing reactive UIs, making the most of concurrency, and integrating database access. At each appropriate stopping point,Hoffman and Nemeth show you how to go from git commit to a continuous delivery pipeline with tools like Wercker, Docker, and Dockerhub, automatically pushing your apps to platform providers like Cloud Foundry/Pivotal Web Services, watching them run there, and assessing their ability to dynamically scale, support failover, fault tolerance, and monitoring.

With cloud-native development rapidly accelerating in importance, these are skills you need now - and no other book brings them together like this. By the time you're finished, you'll be ready to build cloud-native apps that dynamically scale to handle virtually any volume of data, traffic, or users.

Table of Contents

  1. Title Page
  2. Table of Contents
  3. Preface
  4. Dedication
  5. What We’re Going to Build
  6. 1. The Way of the Cloud
    1. The Virtues of the Way of the Cloud
    2. Why Use Go?
  7. 2. Getting Started
    1. Setting up Git
    2. Setting up Go
    3. Testing your Environment
  8. 3. Go Primer
    1. Building Hello Cloud
    2. Using Basic Functions
    3. Working with Structs
    4. Introducing Go Interfaces
    5. Adding Methods to Structs
    6. Working with Third Party Packages
    7. Creating Your Own Packages
  9. 4. Delivering Continuously
    1. Introducing Docker
    2. Continuous Integration with Wercker
    3. Reader Exercise: Create a Full Development Pipeline
    4. Summary
  10. 5. Building Microservices in Go
    1. Designing Services API First
    2. Scaffolding a Microservice
    3. Building Services Test First
    4. Deploying and Running in the Cloud
    5. Summary
  11. 6. Using Backing Services
    1. Designing Service Ecosystems
    2. Building Dependent Services Test-First
    3. Sharing Structured Data Among Services
    4. Using Service Bindings to Externalize URLs and Metadata
    5. Discovering Services
    6. Reader Exercise
  12. 7. Creating a Data Service
    1. Creating a MongoDB Match Repository
    2. Integration Testing a Mongo-Backed Service
    3. Running in the Cloud
  13. 8. Event Sourcing and CQRS
    1. Reality is Event Sourced
    2. Embracing Eventual Consistency
    3. Introducing Command Query Responsibility Segregation
    4. Event Sourcing Use Cases
    5. Code Sample: Managing a Drone Army
    6. Creating a Command Handler Service
    7. Building the Event Processor
    8. Creating the Query Handler Service
    9. Summary
  14. 9. Building a Web Application with Go
    1. Serving Static Files and Assets
    2. Supporting JavaScript Clients
    3. Using Server-Side Templates
    4. Processing Forms
    5. Working with Cookies and Session State
    6. Build and Deploy with Wercker
  15. 10. Security in the Cloud
    1. Securing a Web Application
    2. Securing Microservices
    3. A Word on Privacy and Data Security
    4. Reader Exercise
  16. 11. Working with WebSockets
    1. Demystifying WebSockets
    2. On WebSockets and Cloud Nativity
    3. Building a WebSocket App with a Messaging Provider
  17. 12. Building Web Views with React
    1. JavaScript State of the Union
    2. Why React?
    3. Anatomy of a React Application
    4. Building a Simple React Application
    5. Testing React Applications
    6. Further Reading
  18. 13. Creating UIs that Scale with Flux
    1. Introducing Flux
    2. Building a Flux Application
    3. Summary
  19. 14. Putting it all Together - World of FluxCraft
    1. Introducing World of FluxCraft
    2. Architectural Overview
    3. The Flux GUI
    4. Processing Commands
    5. Processing Events
    6. Maintaining Reality
    7. Map Management
    8. Automating Acceptance Tests
  20. A. Troubleshooting Cloud Applications
    1. Working with Log Streams
    2. Monitoring Health and Performance
    3. Debugging Applications in the Cloud
  21. Remarks