Cover
Title Page
Copyright
Credits
About the Authors
About the Reviewer
Customer Feedback
Table of Contents
Preface
Chapter 1: Modern Microservice Architectures
Why Go?
Basic design goals
Cloud service models
Cloud application architecture patterns
The twelve-factor app
What are microservices?
Deploying microservices
REST web services and asynchronous messaging
The MyEvents platform
Summary
Chapter 2: Building Microservices Using Rest APIs
The background
So, what are microservices?
Microservices internals
RESTful Web APIs
Gorilla web toolkit
Implementing a Restful API
Persistence layer
MongoDB
MongoDB and the Go language
Implementing our RESTful APIs handler functions
Summary
Chapter 3: Securing Microservices
HTTPS
Symmetric cryptography
Symmetric-key algorithms in HTTPS
Asymmetric cryptography
Asymmetrical cryptography in HTTPS
Secure web services in Go
Obtaining a certificate
OpenSSL
generate_cert.go
Building an HTTPS server in Go
Summary
Chapter 4: Asynchronous Microservice Architectures Using Message Queues
The publish/subscribe pattern
Introducing the booking service
Event collaboration
Implementing publish/subscribe with RabbitMQ
The Advanced Message Queueing Protocol
RabbitMQ quickstart with Docker
Advanced RabbitMQ setups
Connecting RabbitMQ with Go
Publishing and subscribing to AMQP messages
Building an event emitter
Building an event subscriber
Building the booking service
Event sourcing
Implementing publish/subscribe and event sourcing with Apache Kafka
Kafka quickstart with Docker
Basic principles of Apache Kafka
Connecting to Kafka with Go
Publishing messages with Kafka
Consuming messages from Kafka
Summary
Chapter 5: Building a Frontend with React
Getting started with React
Setting up Node.js and TypeScript
Initializing the React project
Basic React principles
Kick-starting the MyEvents frontend
Implementing the event list
Bringing your own client
Building the event list components
Enabling CORS in the backend services
Testing the event list
Adding routing and navigation
Implementing the booking process
Summary
Chapter 6: Deploying Your Application in Containers
What are containers?
Introduction to Docker
Running simple containers
Building your own images
Networking containers
Working with volumes
Building containers
Building containers for the backend services
Using static compilation for smaller images
Building containers for the frontend
Deploying your application with Docker Compose
Publishing your images
Deploying your application to the cloud
Introduction to Kubernetes
Setting up a local Kubernetes with Minikube
Core concepts of Kubernetes
Services
Persistent volumes
Deploying MyEvents to Kubernetes
Creating the RabbitMQ broker
Creating the MongoDB containers
Making images available to Kubernetes
Deploying the MyEvents components
Configuring HTTP Ingress
Summary
Chapter 7: AWS I – Fundamentals, AWS SDK for Go, and EC2
AWS fundamentals
The AWS console
AWS command-line interface (CLI)
AWS regions and zones
AWS tags
AWS Elastic Beanstalk
AWS services
AWS SDK for Go
Configuring the AWS region
Configuring AWS SDK authentication
Creating IAM Users
Creating IAM Roles
The fundamentals of the AWS SDK for Go
Sessions
Service clients
Native datatypes
Shared configuration
Pagination methods
Waiters
Handling Errors
Elastic Compute Cloud (EC2)
Creating EC2 instances
Accessing EC2 instances
Accessing EC2 instances from a Linux or macOS machine
Accessing EC2 from Windows
Security groups
Summary
Chapter 8: AWS II – S3, SQS, API Gateway, and DynamoDB
Simple Storage Service (S3)
Configuring S3
Simple Queue Service (SQS)
AWS API gateway
DynamoDB
DynamoDB components
Attribute value data types
Primary keys
Secondary indexes
Creating tables
The Go language and DynamoDB
Summary
Chapter 9: Continuous Delivery
Setting up your project
Setting up version control
Vendoring your dependencies
Using Travis CI
Deploying to Kubernetes
Using GitLab
Setting up GitLab
Setting up GitLab CI
Summary
Chapter 10: Monitoring Your Application
Setting up Prometheus and Grafana
Prometheus's basics
Creating an initial Prometheus configuration file
Running Prometheus on Docker
Running Grafana on Docker
Exporting metrics
Using the Prometheus client in your Go application
Configuring Prometheus scrape targets
Exporting custom metrics
Running Prometheus on Kubernetes
Summary
Chapter 11: Migration
What is a monolithic application?
What are microservices?
Migrating from monolithic applications to microservices
Humans and technology
Cutting a monolithic application to pieces
How do we break the code?
Glue code
Microservices design patterns
Sacrificial architecture
A four-tier engagement platform
Bounded contexts in domain-driven designs
Data consistency
Event-driven architecture for data consistency
Events sourcing
CQRS
Summary
Chapter 12: Where to Go from Here?
Microservices communications
Protocol buffers
GRPC
More on AWS
DynamoDB streams
Autoscaling on AWS
Amazon Relational Database Service
Other cloud providers
Microsoft Azure
Google Cloud Platform
OpenStack
Running containers in the cloud
Serverless architectures
Summary
Index