<p><span>Get familiar with the principles and techniques for designing cost-effective and scalable cloud-native apps with microservices</span></p><p></p><p></p><p></p><p><span>Key Features</span></p><p><span>β Gain a comprehensive understanding of the key concepts and strategies involved in building
Cloud Native Microservices Cookbook: Master the art of microservices in the cloud with over 100 practical recipes
β Scribed by Varun Yadav
- Publisher
- BPB Publications
- Year
- 2024
- Tongue
- English
- Leaves
- 398
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Unlock the secrets of cloud-native success with step-by-step recipes for conquering every stage of microservice deployment
Key Features
β Develop, test, build, and deploy with cloud-native microservices.
β Orchestrate microservices with containerization in the cloud.
β Ensure cloud observability and security in implementation.
Description
The convergence of microservices and cloud technology represents a significant paradigm shift in software development. To fully leverage the potential of both, integration from the outset of application development is crucial. Cloud-native microservices cookbook serve as a conduit, harmonizing disparate elements of microservice construction by establishing a cohesive framework from inception to deployment.
This book meticulously outlines the various stages involved in launching an application utilizing cloud-native microservices. It commences with the foundational aspects of application development, emphasizing microservice architecture principles such as configuration and service discovery, considering cloud infrastructure. Progressing through containerization, continuous integration (CI), and continuous deployment (CD) pipelines, the book explores the intricacies of orchestration, high availability (HA), auto scalability, and cloud security. Subsequently, it elucidates the significance of observability in monitoring microservices post-deployment, concluding with a comprehensive exploration of Infrastructure as Code (IaC) for cloud infrastructure provisioning.
Explore cloud-native microservices basics using real-world examples from the finance sector. Follow curated recipes from concept to cloud deployment for a clear understanding and smooth application development.
What you will learn
β Practical methodology encompassing the development, testing, building, containerization, and orchestration of microservices.
β Software development, spanning from initial design to cloud hosting.
β Achieve microservice auto scalability and high availability.
β Utilizing cloud services and experimenting with newfound services confidently.
β Meticulously track cloud expenditures, alleviating any apprehension surrounding cost management.
Who this book is for
The book is ideal for software developers, solution designers, and DevOps engineers with a foundational understanding of programming concepts and professionals seeking to deepen their expertise in system architecture and full-stack development within cloud environments.
β¦ Table of Contents
Table of Contents
- Microservices and Cloud
Introduction
Structure
Objectives
Importance of microservices
Development
Testing
Deployment
Management
Importance of cloud
Using the Java programming language
Java frameworks for microservices
Configuring cloud services
Recipe 1: Installing AWS command line interface
Installing AWS CLI on Windows
Installing AWS CLI on Linux
Installing AWS CLI on MacOS
Recipe 2: Creating IAM admin user
Steps to create an admin user
Recipe 3: Configuring IAM admin user in the AWS CLI
Recipe 4: Creating an S3 bucket
Creating an S3 bucket using AWS Management Console
Creating an S3 bucket using AWS CLI
Recipe 5: Creating Postgres DB
Creating a PostgresSQL database using AWS Management Console
Creating a PostgresSQL database using AWS CLI
Conclusion
Points to remember
Questions
- Developing Microservices and Test Cases
Introduction
Structure
Objectives
Application description
Development environment setup
Recipe 6: Creating Maven projects
Customer Enquiry
Enquiry Broadcast
Recipe 7: Enhance pom.xml files
Customer Enquiry
Enquiry Broadcast
Recipe 8: Creating Spring Boot application class
Customer Enquiry
Enquiry Broadcast
Running applications
Recipe 9: Connecting RDS PostgressSQL instance
Recipe 10: Creating database schemas
Customer Enquiry
Enquiry Broadcast
Version control systems
Recipe 11: Creating and configuring Git repositories
Customer Enquiry
Enquiry Broadcast
Create merge request
API-first approach
Advantages of API-first approach
Developing microservices
Recipe 12: Creating database tables
Customer Enquiry
Enquiry Broadcast
Recipe 13: Developing Customer Enquiry service
Adding dependency
Adding application.properties
Creating RESTController
Defining financial products
Creating service classes
Creating entity classes
Creating repositories
Code compilation
Recipe 14: Developing Enquiry Broadcast service
Adding dependency
Appending application.properties
Creating RESTController
Creating config class
Creating service class
Creating entity class
Creating repositories
Code compilation
Recipe 15: Creating unit test cases
Adding dependency
Writing test classes
Recipe 16: Enhancing microservices for interservice communication
Adding dependency
Service changes
Recipe 17: Running the application
Recipe 18: Pushing the code to Git repositories
Conclusion
Points to remember
Questions
- Externalize Application Configurations
Introduction
Structure
Objectives
Application configuration
@Value annotation
Recipe 19: Using @Value to inject value as a parameter
Adding a property
Using the property
Profile configuration files
Recipe 20: Using profile specific properties
Creating application-dev.properties
Activating profile
Externalizing configurations
External configuration files
Recipe 21: Using external configuration file
Parameterizing location of Broadcast Enquiry microservice
Externalizing Broadcast Enquiry location
Environment variables
Recipe 22: Using environment variables
Command line arguments
Recipe 23: Using command line arguments
Configuration override order
Version controlled configurations
Recipe 24: Creating Spring Cloud Config Server
Configure server Maven project
Creating server application class
Creating configuration Git repository
Point Config Server to configuration Git Repository
Accessing configurations
Config server details in microservices
Secured configurations
Recipe 25: Integrating with HashiCorp Vault
Setting up a Vault
Storing secrets in a Vault
Config Server with composite backend
Dynamic configurations
Recipe 26: Updating configurations at runtime
Configuring Spring Actuator
Using @RefreshScope
Validating the solution
Conclusion
Points to remember
Questions
- Implementing Dynamic Services
Introduction
Structure
Objectives
Importance of service discovery
Recipe 27: Creating discovery server
Configure server Maven project
Creating server application class
Configuring discovery server
Service discovery patterns
Client-side service discovery
Recipe 28: Client-side discovery using Eureka server
Registering service with Eureka server
Service discovery and invocation
Server-side service discovery
Recipe 29: Creating gateway server
Configure server Maven project
Create server application class
Configuring routing configuration
Configuring gateway server
Recipe 30: Server-side discovery using Spring Cloud Gateway
Configuring gateway server URL
Gateway server invocation and service discovery
Client-side versus server-side service discovery
Service registration patterns
Self-registration
Third-party registration
Conclusion
Points to remember
Questions
- Containerization Using Docker
Introduction
Structure
Objectives
Introduction to containers
Open Container Initiative
Docker
Installing Docker
Recipe 31: Installing Linux Docker Engine on Linux
Uninstalling old versions
Setting up the apt repository
Installing Docker Engine
Recipe 32: Installing Docker Desktop on Windows
Building Docker images
Dockerfile
.dockerignore file
Third-party registration pattern
Entry point script
Recipe 33: Creating entry point scripts
Customer enquiry entry point script
Enquiry Broadcast entry point script
Config Server entry point script
Recipe 34: Creating .dockerignore
Customer Enquiry .dockerignore
Enquiry Broadcast .dockerignore
Enquiry Broadcast .dockerignore
Recipe 35: Creating Dockerfile
Customer Enquiry Dockerfile
Enquiry Broadcast Dockerfile
Config Server Dockerfile
Recipe 36: Build Docker image using CLI
Building Customer Enquiry Docker image
Building Enquiry Broadcast Docker image
Building Config Server Docker image
Verifying created Docker images
Running Docker images
Recipe 37: Run Docker image using CLI
Running Config Server Docker image
Running Customer Enquiry Docker image
Running Enquiry Broadcast Docker image
Recipe 38: Entering Docker containers
Entering Config Server container
Entering Customer Enquiry container
Entering Enquiry Broadcast container
Pushing Docker images to image registry
Repository creation strategy
Recipe 39: Creating a repository in AWS ECR
Creating repository using AWS Management Console
Creating repository using AWS CLI
Recipe 40: Authenticating to ECR
Recipe 41: Pushing images to ECR repository
Pushing Customer Enquiry image
Pushing Enquiry Broadcast image
Pushing Config Server image
Viewing images in the ECR repository
Conclusion
Points to remember
Questions
- Pipeline Automation for CI/CD
Introduction
Structure
Objectives
Introduction to CI and CD pipelines
Benefits of CI/CD pipelines
GitLab CI/CD
Pipeline terminology
.gitlab-ci.yml file
Runners
Jobs
Stages
Building GitLab pipelines
Recipe 42: Creating a .gitlab-ci.yml file
Recipe 43: Viewing pipeline execution
Recipe 44: Enhancing build stage to generate artifact
Recipe 45: Adding a stage to generate Docker image of the artifact
Recipe 46: Enhancing test stage to test the Docker image
Recipe 47: Enhancing deploy stage to push the Docker image to Amazon ECR
Recipe 48: Adding rules in the deployment job to only execute the job conditionally
Linting
Recipe 49: Adding a linting stage to check code style violations
Scheduling GitLab pipelines
Recipe 50: Scheduling a GitLab pipeline
Recipe 51: Using external variables to control pipeline execution
Conclusion
Points to remember
Questions
- Microservices Orchestration
Introduction
Structure
Objectives
Orchestration of microservices
Benefits of orchestration platforms
Load balancer
AWS Application Load Balancer
Recipe 52: Creating AWS Application Load Balancer
Creating Application Load Balancer using AWS CLI
Amazon Elastic Container Service
Amazon ECS cluster
AWS Fargate
Recipe 53: Creating Amazon ECS cluster
Creating ECS cluster using AWS Management Console
Creating ECS cluster using AWS CLI
Amazon ECS task definition
Recipe 54: Creating Amazon ECS task definitions
Creating Config Server ECS task definition
Creating Customer Enquiry ECS task definition with JSON
Creating Enquiry Broadcast ECS task definition with JSON
Amazon ECS service
Recipe 55: Creating Amazon ECS Services
Creating Config Server ECS service
Creating Customer Enquiry ECS service
Creating Enquiry Broadcast ECS service
Recipe 56: Validating Application Load Balancer details
Recipe 57: Creating target group using AWS CLI
Recipe 58: Adding an HTTP listener to an ALB with default rule using AWS CLI
Recipe 59: Adding a conditional rule to a listener
Recipe 60: Validating Application Load Balancer details using AWS CLI
Conclusion
Points to remember
Questions
- Auto Scalability, High Availability, and Disaster Recovery
Introduction
Structure
Objectives
Auto scalability
Automatic ECS scaling
Recipe 61: Auto scaling ECS services with target tracking policies
Recipe 62: Auto scaling ECS services with schedule scaling
Handling scale-in events gracefully
Recipe 63: Handling graceful shutdown in container
High availability
Highly available database
Recipe 64: Amazon RDS for database high availability
Highly available ECS service
Recipe 65: Amazon ECS for high availability
Recipe 66: Enhance load balancer to support multi-AZs
Disaster recovery
Recipe 67: Configure Amazon Route 53 for disaster recovery
Conclusion
Points to remember
Questions
- Cloud Security
Introduction
Structure
Objectives
Identity and access management
IAM policy
Recipe 68: Creating IAM policy for accessing S3 bucket
IAM group
Recipe 69: Creating an IAM user group with permissions on S3 buckets
IAM user
Recipe 70: Creating an IAM user
IAM role
Recipe 71: Creating an IAM role for accessing S3 bucket
Data protection
AWS Key Management Service
Recipe 72: Creating customer managed key
Recipe 73: Using KMS key to encrypt S3
AWS Secrets Manager
Recipe 74: Storing a secret in Secret Manager
Recipe 75: Accessing secret from Secrets Manager in AWS ECS
Recipe 76: Enhance ECS execution role to access Secret Manager
Network security
Virtual Private Cloud
Recipe 77: Creating custom VPC using AWS CLI
Recipe 78: Creating subnets in a VPC using AWS CLI
Security groups
Recipe 79: Creating security group using AWS CLI
Recipe 80: Describing security group using AWS CLI
Recipe 81: Adding a rule to a security group
AWS Web Application Firewall
Recipe 82: Creating Web ACL with rules
Recipe 83: Associating Web ACL with ALB
Conclusion
Points to remember
Questions
- Observability
Introduction
Structure
Objectives
Observability
Benefits of observability
Logging
Container logging
AWS CloudWatch Logs
Recipe 84: Creating a log group
Recipe 85: Instrumenting applications to push logs to CloudWatch
Recipe 86: Viewing logs in CloudWatch
AWS CloudTrail
Recipe 87: Creating trail with AWS CloudTrail
Recipe 88: Viewing CloudTrail Events
Monitoring
CloudWatch Metrics
Custom CloudWatch metrics
Recipe 89: Creating a custom metric
CloudWatch alarms
Recipe 90: Creating a CloudWatch Alarm
Recipe 91: Triggering and viewing an alarm
CloudWatch dashboards
Recipe 92: Creating custom CloudWatch dashboard
Tagging
Recipe 93: Adding tag to S3 bucket using AWS CLI
Recipe 94: Adding tag to ECS cluster using AWS CLI
Recipe 95: Adding tag to AWS RDS using AWS CLI
Recipe 96: Creating cost report for production resources
Conclusion
Points to remember
Questions
- Infrastructure Automation with IaC
Introduction
Structure
Objectives
Introduction to Infrastructure as Code
Terraform
Terraform lifecycle
init
plan
apply
destroy
Terraform provider
Terraform configuration files
Terraform module
Terraform state
Getting started with Terraform
Terraform installation
Recipe 97: Installing Terraform
Installing Terraform on Windows
Installing Terraform on Linux (Ubuntu 20.04 LTS)
Setting the environment
Writing Terraform scripts
Recipe 98: Creating first Terraform script
Recipe 99: Enhancing Terraform script to create an S3 resource
Provisioning infrastructure with Terraform
Recipe 100: Executing Terraform script to provision an S3 resource
Importing existing infrastructure in Terraform
Recipe 101: Importing S3 bucket resource in Terraform
Conclusion
Points to remember
Questions
Index
π SIMILAR VOLUMES
Apply different enterprise integration and processing strategies available with Pulsar, Apache's multi-tenant, high-performance, cloud-native messaging and streaming platform. This book is a comprehensive guide that examines using Pulsar Java libraries to build distributed applications with message-
Apply different enterprise integration and processing strategies available with Pulsar, Apache's multi-tenant, high-performance, cloud-native messaging and streaming platform. This book is a comprehensive guide that examines using Pulsar Java libraries to build distributed applications with message-
The authors of this book explore a way to build cloud-native microservice applications, based on years of practice. Presenting a range of real-world scenarios, from design, development, and testing to deployment, the book shows how teams can leverage cloud-native technologies to develop applications
The Complete Guide to Building Cloud-Based Services Cloud Native Go shows developers how to build massive cloud applications that meet the insatiable demands of todayβs customers, and will dynamically scale to handle virtually any volume of data, traffic, or users. Kevin Hoffman and Dan Nemeth des