O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Microservices with Docker on Microsoft Azure™ (includes Content Update Program)

Book Description

“Beyond just describing the basics, this book dives into best practices every aspiring microservices developer or architect should know.”
—Foreword by Corey Sanders, Partner Director of Program Management, Azure

Microservice-based applications enable unprecedented agility and ease of management, and Docker containers are ideal for building them. Microsoft Azure offers all the foundational technology and higher-level services you need to develop and run any microservices application. Microservices with Docker on Microsoft Azure brings together essential knowledge for creating these applications from the ground up, or incrementally deconstructing monolithic applications over time.
The authors draw on their pioneering experience helping to develop Azure’s microservices features and collaborating with Microsoft product teams who’ve relied on microservices architectures for years. They illuminate the benefits and challenges of microservices development and share best practices all developers and architects should know.

You’ll gain hands-on expertise through a detailed sample application, downloadable at github.com/flakio/flakio.github.io. Step by step, you’ll walk through working with services written in Node.js, Go, and ASP.NET 5, using diverse data stores (mysql, elasticsearch, block storage). The authors guide you through using Docker Hub as a service registry, and Microsoft Azure Container service for cluster management and service orchestration.

Coverage includes:

  • Recognizing how microservices architectures are different, and when they make sense

  • Understanding Docker containers in the context of microservices architectures

  • Building, pulling, and layering Docker images

  • Working with Docker volumes, containers, images, tags, and logs

  • Using Docker Swarm, Docker Compose, and Docker Networks

  • Creating Docker hosts using the Azure portal, Azure Resource Manager, the command line, docker-machine, or locally via Docker toolbox

  • Establishing development and DevOps environments to support microservices applications

  • Making the most of Docker’s continuous delivery options

  • Using Azure’s cluster and container orchestration capabilities to operate and scale containerized microservices applications with maximum resilience

  • Monitoring microservices applications with Azure Diagnostics, Visual Studio Application Insights, and Microsoft Operations Management Suite

  • Developing microservices applications faster and more effectively with Azure Service Fabric

  •  An extensive sample application demonstrating the microservices concepts discussed throughout the book is available.

    Table of Contents

    1. About This E-Book
    2. Title Page
    3. Copyright Page
    4. Dedication Page
    5. Contents at a Glance
    6. Contents
    7. Foreword
    8. Preface
      1. About This Book
      2. Docker Coverage in This Book
        1. Azure Virtual Machines as a Docker Host
        2. Cluster Management and Orchestration on Azure
        3. Development and DevOps for Docker-Based Microservices Applications
        4. Working with Docker
      3. Code Samples and Software Requirements
    9. Acknowledgments
    10. About the Authors
      1. Tech Editors
    11. 1. Microservices
      1. What are Microservices?
        1. Autonomous Services
        2. Small Services
      2. Benefits of Microservices
        1. Independent Deployments
        2. Continuous Innovation
        3. Improved Scale and Resource Utilization
        4. Technology Diversity
        5. Small Focused Teams
        6. Fault Isolation
      3. Challenges
        1. Complexity
        2. Network Congestion and Latency
        3. Data Consistency
        4. Testing
        5. Integration and Versioning
        6. Service Discovery and Routing
        7. Monitoring and Logging
        8. Skillset and Experience
        9. Uptime Service Level Agreement
      4. Best Practices
        1. Encapsulation
        2. DevOps Principles and Culture
        3. Automation
        4. Monitoring
        5. Fault Tolerance
      5. Summary
    12. 2. Containers on Azure Basics
      1. VMs, Containers, and Processes
        1. When Would We Use a Container Over a Virtual Machine or a Process?
      2. Containers on Azure
      3. Creating an Azure VM with Docker
        1. Generating an SSH Public Key on Windows
        2. Generating an SSH Public Key on Mac OS X
        3. Choosing a Virtual Machine Image
        4. Connecting to the VM Using SSH and Git Bash on Windows
        5. Connecting to the VM Using SSH and Git Bash on Mac OS X
        6. Docker Container Basics
      4. Summary
    13. 3. Designing the Application
      1. Determining Where to Start
        1. Coarse-Grained Services
        2. Starting with Microservices
      2. Defining Services and Interfaces
        1. Decomposing the Application
        2. Service Design
      3. Service to Service Communication
        1. Synchronous Request/Response
        2. Asynchronous Messaging
      4. Monolith to Microservices
      5. Flak.io e-Commerce Sample
        1. Flak.io
        2. Requirements
        3. Architecture Overview
        4. Considerations
      6. Summary
    14. 4. Setting Up Your Development Environment
      1. Using Docker for Local Development
        1. Docker for Local Development
        2. Docker for Production Validation
        3. Docker as a Build/Test Host
      2. Developer Configurations
        1. Local Development
        2. Local and Cloud
        3. Cloud Only
        4. Managing Docker Authentication
        5. Choosing a Base Image
        6. Build a Hierarchy of Images
      3. Setting up your Local Dev Environment
        1. Install Docker Tools
        2. Install Developer Tools
        3. Install Windows Utilities
        4. Install OSX Utilities
      4. Docker for Local Development
        1. Local Development Settings
        2. Starting your Local Docker Host
        3. Connecting to a Docker Host
        4. Cloning Samples
        5. Enabling Live Reload in a Docker Container
        6. Volumes
        7. Preparing your Microservice for Production
      5. Docker Compose
      6. Debugging Docker Issues
        1. Unable to Connect to the Docker Host
        2. Containers That Won’t Start
        3. Diagnosing a Running Container
      7. Summary
    15. 5. Service Orchestration and Connectivity
      1. Orchestration
      2. Provisioning
        1. Infrastructure as Code
        2. Azure Resource Manager
        3. Azure Container Service
        4. Multivendor Provisioning
      3. Scheduling and Cluster Management
        1. Challenges
        2. A Scheduling Solution
        3. Docker Swarm
        4. Kubernetes
        5. Apache Mesos
        6. Using Apache Mesos to Run Diverse Workloads
      4. Service Discovery
        1. Service Registration
        2. Service Lookup
        3. Service Registry
        4. Technologies
      5. Other Technologies
      6. Application/API Gateway
      7. Overlay Networking
      8. Summary
    16. 6. DevOps and Continuous Delivery
      1. DevOps Overview
        1. Modern DevOps
        2. DevOps Culture
      2. Continuous Integration, Delivery, and Deployment
        1. Creating Environments in Azure
      3. Deploying a Microservice with Continuous Delivery
        1. Application Configuration Changes Across Different Environments
        2. Continuous Integration
        3. Testing in a QA Environment
        4. Deploying to Staging
        5. Testing in Production
      4. Choosing a Continuous Delivery Tool
        1. On-Premises or Hosted?
        2. On-Premises or Hosted Build Agents?
        3. Best-of-breed or Integrated Solution?
        4. Does the Tool Provide the Extensibility You Need?
        5. Comparison of Jenkins, Team Services, Bamboo, and Tutum
        6. Docker Cloud (Formerly Called Tutum)
      5. Summary
    17. 7. Monitoring
      1. Monitoring the Host Machine
      2. Monitoring Containers
      3. Monitoring Services
      4. Monitoring Solutions
        1. Azure Diagnostics
        2. Application Insights
        3. Operations Management Suite (OMS)
        4. Recommended Solutions by Docker
      5. Summary
    18. 8. Azure Service Fabric
      1. Service Fabric Overview
        1. Service Fabric Subsystems
      2. Cluster Management
      3. Resource Scheduling
        1. Service Fabric Application
        2. Custom Applications (Existing Applications)
        3. Container Integration
      4. Service Discovery
      5. Programming Model
        1. Stateless Services
        2. Stateful Services
        3. Reliable Actors
        4. Reliable Services
      6. Application Lifecycle
        1. Service Updates
        2. Application Upgrades
        3. Testability Framework
      7. Summary
    19. A. ASP.NET Core 1.0 and Microservices
      1. A New Version of ASP.NET
        1. Getting Started
        2. Choosing the Right ASP.NET Docker Image
        3. Visual Studio 2015 Tooling
        4. ASP.NET Microservices Best Practices
    20. Index
    21. Inside Front Cover
    22. Inside Back Cover
    23. Code Snippets