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 Azure

Book Description

Architect enterprise-grade, Microservice-based solutions using Microsoft Azure Service Fabric.

About This Book

  • Explore architectural patterns for building modern day Microservice-based systems
  • Learn about Microsoft Service Fabric as a platform to host distributed Microservices
  • Discover multiple options for hosting Microservices on heterogeneous, cross-platform environments
  • Learn to configure Azure Service Fabric clusters for enterprise-grade service deployments

Who This Book Is For

The book is aimed at IT architects, system administrators, and DevOps engineers who have a basic knowledge of the Microsoft Azure platform and are working on, or are curious about, the concepts of Microservices and Microservice architecture.

What You Will Learn

  • Understand the basics of Microservices and how Microsoft Azure fits into the equation
  • Master Azure Service Fabric architecture and services
  • Explore Azure Service Fabric application programming models
  • Comprehensive study of various architecture patterns for building enterprise-grade Microservices
  • Manage and deploy Microservices on Azure Service Fabric
  • An insight into the future of Microservices with containers and serverless computing

In Detail

Microsoft Azure is rapidly evolving and is widely used as a platform on which you can build Microservices that can be deployed on-premise and on-cloud heterogeneous environments through Microsoft Azure Service Fabric. This book will help you understand the concepts of Microservice application architecture and build highly maintainable and scalable enterprise-grade applications using the various services in Microsoft Azure Service Fabric. We will begin by understanding the intricacies of the Microservices architecture and its advantages over the monolithic architecture and Service Oriented Architecture (SOA) principles. We will present various scenarios where Microservices should be used and walk you through the architectures of Microservice-based applications. Next, you will take an in-depth look at Microsoft Azure Service Fabric, which is the best–in-class platform for building Microservices. You will explore how to develop and deploy sample applications on Microsoft Azure Service Fabric to gain a thorough understanding of it.

Building Microservice-based application is complicated. Therefore, we will take you through several design patterns that solve the various challenges associated with realizing the Microservices architecture in enterprise applications. Each pattern will be clearly illustrated with examples that you can keep referring to when designing applications.

Finally, you will be introduced to advanced topics such as Serverless computing and DevOps using Service Fabric, to help you undertake your next venture with confidence.

Style and approach

This book introduces its readers to the concept of Microservices and Microsoft Azure Service Fabric as a distributed platform to host enterprise-grade Microservices. It then addresses common architectural challenges associated with the Microservice architecture, using proven architectural patterns.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. Microservices – Getting to Know the Buzzword
    1. What are Microservices?
      1. Microservices hosting platform
      2. The Microservice advantage
        1. Fault tolerance
        2. Technology-agnostic
        3. Development agility
        4. Heterogeneous deployment
        5. Manageability
        6. Reusability
    2. The SOA principle
      1. Issues with SOA
    3. The Microservices solution
    4. Inter-Microservice communication
      1. Communication through user interface
        1. Sharing common code
        2. Composite user interface for the web
        3. Thin backend for rich clients
      2. Synchronous communication
      3. Asynchronous communication
      4. Orchestrated communication
      5. Shared data
    5. Architecture of Microservices-based systems
    6. Conway's law
    7. Summary
  3. Microsoft Azure Platform and Services Primer
    1. PaaS for Microservices
      1. Abstract infrastructure challenges
      2. Simplified application lifecycle management
      3. Simplifying development
    2. Microsoft Azure – the choice of a hosting platform
    3. Summary
  4. Understanding Azure Service Fabric
    1. The Service Fabric advantage
      1. Highly scalable
        1. Support for partitioning
      2. Rolling updates
      3. State redundancy
      4. High-density deployment
      5. Automatic fault tolerance
      6. Heterogeneous hosting platforms
      7. Technology agnostic
      8. Centralized management
    2. Service Fabric as an orchestrator
      1. Orchestration as a Service
        1. Is a cluster resource manager similar to an Azure load balancer?
        2. Architecture of cluster resource manager
    3. Architecture of Service Fabric
      1. Transport Subsystem
      2. Federation Subsystem
      3. Reliability Subsystem
      4. Management Subsystem
      5. Hosting subsystem
      6. Communication subsystem
      7. Testability Subsystem
    4. Deconstructing Service Fabric
      1. Infrastructure model
        1. Cluster
        2. Node
      2. System services
        1. Naming service
        2. Image store service
        3. Upgrade service
        4. Failover manager service
        5. Cluster manager service
        6. Service placement
      3. Application model
      4. Programming model
        1. Guest Executables
        2. Reliable Services
        3. Reliable Actors
    5. Creating a cluster on Azure
      1. Basics
      2. Cluster configuration
      3. Security
      4. Summary
      5. Viewing your cluster status
    6. Service Fabric Explorer
      1. Summary view
      2. Cluster Map
        1. Fault domains
        2. Upgrade domains
      3. Viewing applications and services
        1. Cluster nodes
        2. Actions
        3. System
    7. Preparing your system
    8. Summary
  5. Hands-on with Service Fabric – Guest Executables
    1. Service Fabric discovery and communication
      1. Service protocols
      2. Service discovery
      3. Connections from applications external to Service Fabric
      4. Configuring ports and protocols
        1. Configuring the service manifest
      5. Configuring the custom endpoint
      6. Configuring the Azure load balancer
      7. Configuring the health check
    2. Built-in communication API
    3. Deploying a Guest Executable
      1. Understanding the manifests
      2. Package structure
        1. Packaging Guest Executables using Visual Studio
        2. Manually packaging a Guest Executable
          1. Creating the directory structure
          2. Adding code and configuration
          3. Updating service manifest
          4. Updating the application manifest
      3. Deployment
    4. Deploying a Guest Container
      1. Deploying Windows Container
        1. Container image deployment and activation
        2. Resource governance
        3. Container port to host port mapping
        4. Container-to-container discovery and communication
        5. Configuring and setting environment variables
      2. Deploying a Linux container
    5. Summary
  6. Hands on with Service Fabric – Reliable Services
    1. Exploring the Service Fabric Explorer
      1. Application Type
      2. Application instance
      3. Service type
      4. Partition
      5. Replica
    2. Stateless Reliable Services
      1. Stateless service architecture
      2. Stateless service lifecycle
      3. Scaling stateless services
        1. Stateless frontend and stateless middle-tier
        2. Stateless frontend and stateful middle-tier
    3. Reliable Services communication
    4. Exploring the application model
    5. Stateful service
      1. Stateful service architecture
      2. Reliable Collections
        1. Up and down counter application
      3. Stateful service lifecycle
      4. Service partitioning
      5. Service replicas
    6. Summary
  7. Reliable Actors
    1. Actor model
    2. What is an Actor?
    3. Actors in Service Fabric
    4. Actor lifetime
    5. Saving state
    6. Distribution and failover
    7. Actor communication
      1. The Actor proxy
      2. Concurrency
      3. Reentrancy
    8. Asynchronous drivers
      1. Timers
      2. Actor reminders
      3. Actor events
    9. Your first Reliable Actors application
    10. Summary
  8. Microservices Architecture Patterns Motivation
    1. Creating an architecture
      1. Defining the solution boundaries
      2. Creating the solution structure
      3. Component design
    2. Classification of architectural patterns
      1. Optimization or non-functional patterns
      2. Operational patterns
      3. Implementation or functional patterns
    3. Picking up the right architecture pattern
      1. Context
      2. Forces
      3. Complementing patterns
    4. Applying a pattern
      1. Structural variation
      2. Behavioral variation
      3. Internal variation
      4. Domain dependent variation
    5. Summary
  9. Microservices Architectural Patterns
    1. Architectural patterns
    2. Service proxy
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    3. Service Façade \ API Gateway
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    4. Reliable Data Store
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    5. Cluster Orchestrator
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    6. Auto-scaling
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    7. Partitioning
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    8. Centralized Diagnostics Service
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    9. High Density Deployment
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    10. API Gateway
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    11. Latency Optimized Load Balancing
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    12. Queue Driven Decomposing Strategy
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    13. Circuit Breaker
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    14. Message Broker for Communication
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    15. Compensating Transaction
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    16. Rate Limiter
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    17. Sagas
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    18. Master Data Management
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    19. CQRS – Command Query Responsibility Segregation
      1. Problem
      2. Solution
        1. Microservices in CQRS
        2. Advantages
      3. Considerations
      4. Related patterns
      5. Use cases
    20. Event Sourcing
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    21. Remindable Actors
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    22. Managed Actors
      1. Problem
      2. Solution
      3. Considerations
      4. Related patterns
      5. Use cases
    23. Summary
  10. Securing and Managing Your Microservices
    1. Securing the communication channels
      1. Inter-node communication
    2. Client to node security
      1. Certificate security
      2. Azure Active Directory security
    3. Publishing an application to a secured cluster
    4. Managing Service Fabric clusters with Windows PowerShell
      1. Prerequisites
      2. Deploying Service Fabric applications
      3. Upgrading Service Fabric applications
      4. Removing Service Fabric applications
    5. Summary
  11. Diagnostics and Monitoring
    1. Health entities
    2. Health state
      1. Health policies
        1. Cluster health policy
        2. Application health policy
        3. Service type health policy
    3. Health evaluation
    4. Health reporting
    5. Centralized logging
    6. Collecting logs
    7. Diagnostic extension
      1. Deploying the Diagnostics extension
    8. Summary
  12. Continuous Integration and Continuous Deployment
    1. Continuous Integration
    2. Continuous Delivery
      1. Deploying Service Fabric application on a standalone cluster
        1. Deploying the application
    3. Summary
  13. Serverless Microservices
    1. Before committing to Nanoservices
    2. Building Nanoservices with Azure Functions
    3. Function app templates
    4. Timer function apps
    5. Data processing function apps
    6. Webhook and API function apps
    7. Summary