<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ebrahim Gomaa</title>
    <description>The latest articles on DEV Community by Ebrahim Gomaa (@devyetii).</description>
    <link>https://dev.to/devyetii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F236353%2Fce78a93f-2449-47d8-839e-6a391d90b57c.jpg</url>
      <title>DEV Community: Ebrahim Gomaa</title>
      <link>https://dev.to/devyetii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devyetii"/>
    <language>en</language>
    <item>
      <title>Container Migration Methodology</title>
      <dc:creator>Ebrahim Gomaa</dc:creator>
      <pubDate>Sun, 10 Oct 2021 18:48:07 +0000</pubDate>
      <link>https://dev.to/devyetii/container-migration-methodology-3gll</link>
      <guid>https://dev.to/devyetii/container-migration-methodology-3gll</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Businesses have recently developed great interest in Container-based architectures as it's more suitable for agile architectures.&lt;/p&gt;

&lt;p&gt;The following chart from Grand View Research shows the growth of the application&lt;br&gt;
container market size in the United States.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fUqlFlGt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j33hmxjuvf15gk4d3o6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fUqlFlGt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j33hmxjuvf15gk4d3o6k.png" alt="container market size in the United States"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this guide; you as Architect or Ops engineer will find your way through migrating to an AWS container service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why migrate to the AWS cloud ?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agility and product improvement&lt;/strong&gt; over regular instances&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Savings&lt;/strong&gt; by improving resource utilization and flexible scaling up/down&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elasticity&lt;/strong&gt; of scaling up/down according to the business needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster Innovation&lt;/strong&gt; by hosting control plane to the cloud and releasing more resources for innovation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploy globally in minutes&lt;/strong&gt; via 77 AZs across 24 geographic Regions worldwide&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why migrate to Amazon Container Service ?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DevOps driver u&lt;/strong&gt;sing managed container technology to support DevOps on the
cloud platform which further improves efficiency and increase customer migration pace to containers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform as a Service (PaaS) platform building:&lt;/strong&gt; build your own containerized platform on the cloud and combine them with your DevOps operation for improved efficiency and flexibility, also reduced complexity by unifying DevOps and Production environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operations simplification&lt;/strong&gt; using managed container services to relieve the management and operations burden also gain improved efficiency integrating with deeply integrated services&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expectation of the same user experience as native Kubernetes&lt;/strong&gt; with services like EKS which provide the convenience of hosted services plus the freedom of open source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Digital transformation&lt;/strong&gt; which involves the development of digital technologies and support capabilities to create a vibrant digital business model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IoT/ML innovation&lt;/strong&gt; Model training and deployment in the cloud&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deep integration with AWS&lt;/strong&gt;  leverage the breadth and depth of AWS cloud technologies, including networking, security, and monitoring&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security and compliance —&lt;/strong&gt; AWS offers 210 security, compliance and governance-related services and key features, also isolation between containers and granular access permissions per container&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  AWS Capabilities for Containers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For Serverless computing for containers, use &lt;a href="https://aws.amazon.com/fargate/"&gt;AWS Fargate&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you want to manage your computing environment for containers, use &lt;a href="https://aws.amazon.com/ec2/"&gt;Amazon EC2 (Elastic Cloud Compute)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For deeply-integrated AWS container orchestration, use &lt;a href="https://aws.amazon.com/ecs/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;amp;whats-new-cards.sort-order=desc&amp;amp;ecs-blogs.sort-by=item.additionalFields.createdDate&amp;amp;ecs-blogs.sort-order=desc"&gt;Amazon ECS (Elastic Container Service)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For managed Kubernetes-in-the-cloud service with zero-refactoring migration, use &lt;a href="https://aws.amazon.com/eks/"&gt;Amazon EKS (Elastic Kubernetes Service)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For fully-managed container registry (container images library), use &lt;a href="https://aws.amazon.com/ecr/"&gt;Amazon ECR (Elastic Container Registry)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For managing microservice architectures across multiple compute infrastructure services (EC2 - ECS - EKS - Fargate), use &lt;a href="https://aws.amazon.com/app-mesh/?aws-app-mesh-blogs.sort-by=item.additionalFields.createdDate&amp;amp;aws-app-mesh-blogs.sort-order=desc&amp;amp;whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;amp;whats-new-cards.sort-order=desc"&gt;AWS App Mesh&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Strategy for Container Management
&lt;/h2&gt;

&lt;p&gt;Before formulating the migration plan, Architects should evaluate the customer's preperation to the migration process to ensure that it will solve their problems, also to provide the basis for the customer to help make decisions throughout the plan. Following is the aspects of evaluation for the customer's preparation&lt;/p&gt;

&lt;h3&gt;
  
  
  Business Capabilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Business Target&lt;/strong&gt; — Targeted benefits from the migration process. Involved rules include business managers, financial managers, budget owners, migration decision makers and stakeholders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;People —&lt;/strong&gt; Who from the customer's IT personnel will be involved in the migration process , and staffing demanding for the process according to Technical skills. Also training the tech staff for the new technology. Involved rules include HRs, staffing specialists and people managers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Governance —&lt;/strong&gt; Evaluating involved teams in the process and people in charge of these teams. Also evaluating the final decision maker for the decision chain. It also involves evaluating the effectiveness of PM tools and communication. For the customer, provide a way for measuring project results (e.g. cost reduction ratio). Rules involved include CIOs, PMs and Enterprise Architects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical Capabilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Platform&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Platform —&lt;/strong&gt; Customer's familiarity with the AWS cloud platform and basic container services within it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container Platform —&lt;/strong&gt; Customer's familiarity with the AWS cloud container platform and their related skill set.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assessment Method —&lt;/strong&gt; Consider the &lt;a href="https://aws.amazon.com/blogs/apn/apn-partners-can-now-conduct-aws-immersion-day-workshops-for-their-customers/"&gt;AWS APN Immersion Day&lt;/a&gt; tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proof of Concept (PoC) —&lt;/strong&gt; Understand and assess customer's familiarity with the AWS platform and services through a simple PoC. After the demo, the customer needs to know the basics of EKS and the difference between it and other services/platforms, also the best method to understand EKS.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Compliance —&lt;/strong&gt; Evaluate the customer requirements on AWS infrastructure security, IAM rules and RBAC such as node IAM, cluster IAM and Pod execution. Also evaluate requirements for service accounts the customer needs and its minimum permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operations&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring — M&lt;/strong&gt;etrics, tooling and methodology to build the monitoring system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alarm —&lt;/strong&gt; Customer's requirements for alarms, alarm indicators and impact of alarms on business.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analysis —&lt;/strong&gt; Customer's analysis requirements in the container operations field, such as attacks and error root cause analysis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release Management —&lt;/strong&gt; Tools and process used by the customer for release management and the migration method or optimization plan for release through the evaluation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disaster Tolerance —&lt;/strong&gt; Customer's disaster tolerance requirements and recovery plan.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Container Migration Maturity Model
&lt;/h2&gt;

&lt;p&gt;This graph shows how difficult should the migration project will be depending on two factors: Platform operation capabilities (which affects customer's use of the new container platform during and after migration) and the source tech stack. (which affects difficulty and workload of the migration. Also the operation team capabilities and functions determines whether the customer can achieve the migration goal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XEYPZdRR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qyk3ab7njscm8204bz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XEYPZdRR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qyk3ab7njscm8204bz3.png" alt="Migration process difficulty"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical challenges of container and orchestration tools :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring&lt;/strong&gt; — Monitoring methods change from typical servers to containers and services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logging —&lt;/strong&gt; The need to know which container from which host to collect logs from makes it difficult especially by the increase, decrease and movement of containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Troubleshooting —&lt;/strong&gt; Difficulty to analyze container failures by adopting past behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security —&lt;/strong&gt; The impact of &lt;strong&gt;r&lt;/strong&gt;apid development of the community version on security guarantees. Permission management poses new challenges to operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network —&lt;/strong&gt; Increased difficulty of network planning and design.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Evaluating the source cluster tech stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compatible K8s —&lt;/strong&gt; Migrating from K8s cluster built on AWS or other cloud providers through tools like Kubeadmin to Amazon EKS. Easiest because of infrastructure consistency and similar tooling. Some considerations in case of network plugins, Ingress and image repos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variant of K8s —&lt;/strong&gt; K8s cluster provided by third-party platforms like RedHat OpenShift. Differences from its deployment from the typical K8s cluster adds to the difficulty of the migration process&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heterogenous container orchestration engine —&lt;/strong&gt; Migrating from other orchestration stack than Kubernetes. Huge difference in design concepts and implementation adds to the difficulty of the migration process&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containerization —&lt;/strong&gt; Migrating from server deployment to containerized application. This introduces three main risks which are lack of developer support in the customer's IT team, lack of deployment instruction documents and customer's micro-service requirements, so it's considered the most technically difficult.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Mobilization stage
&lt;/h2&gt;

&lt;p&gt;This stage has 5 main goals: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Investigate the goals of migration&lt;/li&gt;
&lt;li&gt;Build the migration team&lt;/li&gt;
&lt;li&gt;Assign roles and responsibilities&lt;/li&gt;
&lt;li&gt;Evaluate migration methods&lt;/li&gt;
&lt;li&gt;Formulate migration project plan&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Discover
&lt;/h3&gt;

&lt;p&gt;Understanding customer's technical and business goals and migration targets through questionnaires and interviews&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Discover Business Information (DBI)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;What is the target application system for migration? Which business unit does it belong to? Do they have any important business activities recently?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migration cycle&lt;/strong&gt; — When does it start? What is the time span? Is there a clear deadline?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migration expectations&lt;/strong&gt; — What is the goal to achieve? Does the customer have any clear metrics?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personnel&lt;/strong&gt; — What is the number of personnel responsible for the migration? What kind of skills do they possess? Which modules are they responsible for?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt; — What is the labor cost? Migration cost? Dual environment parallel run cost? Target cluster planning cost?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discover Technical Information (DTI)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Where is the platform of the source cluster?&lt;/li&gt;
&lt;li&gt;What is the source cluster’s actual usage of computing, storage, and network resources?&lt;/li&gt;
&lt;li&gt;Is the application stateful or stateless?&lt;/li&gt;
&lt;li&gt;What are the dependencies among applications?&lt;/li&gt;
&lt;li&gt;What is the technology stack used by the platform where the source cluster is located?&lt;/li&gt;
&lt;li&gt;Is there any source container cluster-specific information?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Report
&lt;/h3&gt;

&lt;p&gt;Prepare a research report including the following information about selecting migration methods and &lt;strong&gt;output&lt;/strong&gt; solutions (not limited)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cluster information&lt;/li&gt;
&lt;li&gt;Image repositories&lt;/li&gt;
&lt;li&gt;Log collection subsystem&lt;/li&gt;
&lt;li&gt;Monitoring subsystem&lt;/li&gt;
&lt;li&gt;CI/CD subsystem&lt;/li&gt;
&lt;li&gt;Business impact&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose a migration method
&lt;/h3&gt;

&lt;p&gt;Depending on the container migration maturity model (People - Tooling - Source platform), you can recommend a suitable migration method to the customer. Here we discuss the migration methods of different &lt;strong&gt;Source platforms&lt;/strong&gt; mentioned before&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compatible K8s —&lt;/strong&gt; If the source cluster is on AWS, it's easy to migrate through AWS tools, no matter stateless or stateful. If on another cloud platform, it's easy to migrate it with AWS tools if stateless. If stateful, you'll need another third-party partner software&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variant Kubernetes —&lt;/strong&gt; Depends on source platform&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heterogenous container orchestration engine —&lt;/strong&gt; From the design concept to the specific deployment, different container orchestration engines differ a lot, so this type of migration project becomes very complicated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containerization —&lt;/strong&gt; The most complex, requires refactoring of the whole containerized architecture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;With CI/CD system —&lt;/strong&gt;  Configuring and labeling network and working nodes enables you to automate release processing targeted to EKS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Planning
&lt;/h3&gt;

&lt;p&gt;Formulating guidance plan for the migration process. Using project management best practices and agile delivery, include the following in your plan&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review project management methods, tools, and capabilities for gap analysis.&lt;/li&gt;
&lt;li&gt;Define project management methods and tools, and how to use them in the project.&lt;/li&gt;
&lt;li&gt;Define project communication methods and problem escalation mechanisms.&lt;/li&gt;
&lt;li&gt;Develop a project task scheduling table, and clarify project risks and solutions.&lt;/li&gt;
&lt;li&gt;Decide the composition of the migration team, and clarify the responsibilities of the team.&lt;/li&gt;
&lt;li&gt;Outline the resources and costs required to migrate the target environment to AWS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For technical planning, include the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discover the application dependency, which is critical for project prioritization and planning.&lt;/li&gt;
&lt;li&gt;Clarify the migration priority of the applications, and select the appropriate application system for migration verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AWS Landing Zone
&lt;/h3&gt;

&lt;p&gt;Following configuration will be predefined to you when you use &lt;a href="https://aws.amazon.com/solutions/implementations/aws-landing-zone/"&gt;AWS Landing Zone&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Account structure —&lt;/strong&gt; Initial multi-account structure with baseline security&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network structure —&lt;/strong&gt; Basic network configurations for network isolation, connection between AWS and the local network and user-configurable network access and management options. You should still plan for the EKS Pod IP bool based on the characteristics of the CNI network plug-in&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Account security baseline —&lt;/strong&gt; Settings for AWS CloudTrail - Config - IAM, Cross account access and Amazon VPC - GuardDuty&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS user access management —&lt;/strong&gt; Provide a framework for cross account user IAM based on Microsoft Active Directory, centralized cost mangement and reporting. Creation and management of users and permissions for the Amazon EKS cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Skills/Cloud Center of Excellence (CCoE)
&lt;/h3&gt;

&lt;p&gt;This is a group of people experiences with AWS and Amazon EKS experience whom you should train to lead the migration process. You should also design how the CCoE team will lead and perform the migration task.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operations Model
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Basic Environment management —&lt;/strong&gt; Customers must operate and maintain computing, storage, network, and permissions with managed services to reduce the workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container cluster operations —&lt;/strong&gt; Worker node management (managed and
unmanaged), worker node upgrade methods, dynamic scaling of work nodes, Pod capacity management, application deployment, and so on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring —&lt;/strong&gt; Monitoring the status of hosts, pods and application servers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logging —&lt;/strong&gt; Collecting and processing logs of hosts and pods.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release management —&lt;/strong&gt; Version control, CI/CD (DevOps)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change management —&lt;/strong&gt; Deployment and process description of the change management tools to manage changes in the original process throughout the migration process&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security and compliance
&lt;/h3&gt;

&lt;p&gt;According to customer's needs and following these best practices&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cluster Design&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;For cloud infrastructure security, see &lt;a href="https://d1.awsstatic.com/architecture-diagrams/ArchitectureDiagrams/dod-scca-multiaccount-ra.pdf"&gt;Secure Cloud Computing Architecture (SCCA) on AWS GovCloud (US)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;IAM Roles — User roles, resource roles, and Pod roles&lt;/li&gt;
&lt;li&gt;Managed or unmanaged Node Groups&lt;/li&gt;
&lt;li&gt;Control SSH login&lt;/li&gt;
&lt;li&gt;EC2 security group — Security group reference and port opening between services&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Network isolation — VPC, subnet, AWS PrivateLink, VPC peering&lt;/li&gt;
&lt;li&gt;Restrict network access to API server endpoint&lt;/li&gt;
&lt;li&gt;Open the private endpoint of the API server&lt;/li&gt;
&lt;li&gt;Protection service load balancers — Network Load Balancer (NLB) or Application Load Balancer (ALB)? ALB ingress or Nginx ingress?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Images&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Build secure images — Content addressable image identifier (CAIID)&lt;/li&gt;
&lt;li&gt;Use vulnerability scanning — Images scanner tools&lt;/li&gt;
&lt;li&gt;Image Repository — Use private image repository&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime Security —&lt;/strong&gt; Restricting Pod permissions

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespace —&lt;/strong&gt; Provide scoping for cluster objects; allow fine-grained cluster object management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RBAC&lt;/strong&gt; &lt;strong&gt;—&lt;/strong&gt; Manage the authorization of the cluster based on the least privilege principle with periodic audits to protect customers from external threats and internal misconfiguration or accidents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restrict the runtime permissions —&lt;/strong&gt; Minimizing capabilities of the running containers to protect from malicious and misbehaving containers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pod security strategy —&lt;/strong&gt; Enforcing K8s and EKS security best practices (e.g. Not running as root - not sharing host node's process or network space - enforcing SELinux)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Migration
&lt;/h3&gt;

&lt;p&gt;Implementing your migration plan with simple application migration requested by the customer to try migration experience. This stage is preceded by designing 4 plans so far : Migration plan (AWS architecture - app architecture - operations process), testing plan, Cutover plan and Rollback plan in case of unsuccessful cutover. The CCoE team should lead the migration process and you can also use automated tooling. It's good to set a checklist (customer-specific) to confirm migration completion before cutover.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Validation
&lt;/h3&gt;

&lt;p&gt;Test migration before cutover&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functional verification&lt;/li&gt;
&lt;li&gt;Performance verification&lt;/li&gt;
&lt;li&gt;Disaster Recovery&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cutover
&lt;/h3&gt;

&lt;p&gt;Switch the transaction flow to the new system with close watching. If any abnormal behavior was detected, run the rollback plan. This process requires the playbook and the runbook being output before hand. It also needs exercising before performing, and extensive CCoE team support because of their wide experience with diverse migration teams.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>Web Application Hosting in the AWS Cloud</title>
      <dc:creator>Ebrahim Gomaa</dc:creator>
      <pubDate>Wed, 08 Sep 2021 22:41:15 +0000</pubDate>
      <link>https://dev.to/awsmenacommunity/web-application-hosting-in-the-aws-cloud-19j3</link>
      <guid>https://dev.to/awsmenacommunity/web-application-hosting-in-the-aws-cloud-19j3</guid>
      <description>&lt;h2&gt;
  
  
  An overview of traditional web hosting
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27t5puiw8nr8vwiwqize.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27t5puiw8nr8vwiwqize.png" alt="Traditional"&gt;&lt;/a&gt;&lt;br&gt;
This image depicts the traditional architecture of a three-tier web app. In the following sections, we'll show how easily this architecture can be built using AWS.  &lt;/p&gt;




&lt;h2&gt;
  
  
  Web app hosting in the cloud using AWS
&lt;/h2&gt;

&lt;p&gt;After studying the value moving to the cloud and deciding its better for your case, this section helps you architect your application in the cloud using AWS&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS can solve common web app hosting problems
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cost effectiveness&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Leveraging automatic scaling (up/down) based on traffic provisioning to cut out useless capacity at non-peak times, to ensure cost-effective usage of resources.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0ahpdzghryoq7ymvd5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0ahpdzghryoq7ymvd5w.png" alt="Cost Effectiveness"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fast-response scalability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fast-responding scalability in case of unexpected loads if compared to the down time encountered by the traditionally hosted apps in case of unexpected peaks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Managing Different environments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Easily and cost-effectively manage environments (test/beta/staging) to ensure quality of the application at different stages of its development lifecycle. This helps use this parallel fleet optimally when and as needed. You can also use this parallel fleet as staging environment for your new release and leverage &lt;a href="https://en.wikipedia.org/wiki/Blue-green_deployment" rel="noopener noreferrer"&gt;Blue-Green Deployment&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  An AWS Cloud architecture for web app hosting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2dqxvobaumakeorbbhjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2dqxvobaumakeorbbhjb.png" alt="AWS Cloud Arch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DNS services with Amazon Route 53&lt;/strong&gt; simplifies domain management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cache-hit-ratio-explained.html" rel="noopener noreferrer"&gt;Edge caching&lt;/a&gt; with AWS CloudFront&lt;/strong&gt; to decrease latency of content to users&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge security for Amazon CloudFront with AWS WAF&lt;/strong&gt; customer-defined rules to filter malicious traffic (XSS - SQL injections)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Load balancing with Elastic Load Balancing (ELB)&lt;/strong&gt; spread load over Availability Zones and use AWS Auto Scaling groups for redundancy&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DDoS protection with AWS Shield&lt;/strong&gt; for Network and Transport layers DDoS attacks protection automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firewalls with security groups&lt;/strong&gt; host-level stateful firewall for both web and app servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching with AWS ElastiCache&lt;/strong&gt; leverage Redis and Memcached for lower latency of frequent requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed Databases with Amazon RDS&lt;/strong&gt; highly available, multi-AZ DB architecture with 6 possible DB engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static Storage and backups with Amazon S3&lt;/strong&gt; simple, HTTP-based object storage for backups and assets.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Components of AWS Cloud web app hosting architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network Management&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Security groups provide host-level security&lt;/li&gt;
&lt;li&gt;Amazon VPC :

&lt;ul&gt;
&lt;li&gt;enables running resources in an isolated network that you defined.&lt;/li&gt;
&lt;li&gt;helps create hybrid architecture via hardware VPNs to extend your datacenter using AWS cloud.&lt;/li&gt;
&lt;li&gt;Works with both IPv4 and IPv6.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Content Delivery&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;CDN (Content Delivery Network) provide a network of edge locations to deliver your content in a geo-dispersed fashion though edge caching.&lt;/li&gt;
&lt;li&gt;For dynamic content, CDN retrieves data from the origin server&lt;/li&gt;
&lt;li&gt;You can use CloudFront as a global network of your static, dynamic and streaming content.&lt;/li&gt;
&lt;li&gt;CloudFront is optimized for working with AWS services (like S3 and EC2) with a pay-as-you-go pricing method.&lt;/li&gt;
&lt;li&gt;Any other edge caching solution should work well in the AWS cloud.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Managing public DNS&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Route 53 is a scalable and highly-available AWS-optimized cloud DNS service. It's also fully compliant with IPv6&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Host Security&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Use EC2 security groups, which are analogues to firewalls, to limit inbound access to your instance to only specific subnets, IP addresses and resources.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Load Balancing&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Amazon ELB (Elastic Load Balancer) is used to distribute incoming traffic across multiple targets in the same AZ or across multiple AZs.&lt;/li&gt;
&lt;li&gt;It offers 4 types of LBs, all provided with high-availability, scalability and security.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Finding hosts and services&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Most IPs in the AWS are dynamic&lt;/li&gt;
&lt;li&gt;EC2 instances are provided both public and private DNS endpoints that are accessible through the internet&lt;/li&gt;
&lt;li&gt;You should assign a Static IP address (Elastic IP in the AWS terminology) for instances and services that require consistent endpoints, such as primary databases, central file servers, and EC2-hosted load balancers.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Caching&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Amazon ElastiCache is a highly-available and auto scalable in-memory cache web service that's protocol compliant with Memcached and Redis.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;DB (Config, Backups and failover)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using Amazon RDS&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Provide access to popular DB engines in the cloud&lt;/li&gt;
&lt;li&gt;Supports MySQL, PostgreSql, MS SQL Server and Oracle.&lt;/li&gt;
&lt;li&gt;Easy and flexible scalability of both compute resources and storage capacity&lt;/li&gt;
&lt;li&gt;Backup with retention periods&lt;/li&gt;
&lt;li&gt;Multi-AZ deployments for increased availability&lt;/li&gt;
&lt;li&gt;Read replicas to scale out for heavy read workloads&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Hosting and RDBMS on EC2 instance&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Install your RDBMS of choice on an EC2 instance&lt;/li&gt;
&lt;li&gt;Ultimate flexibility of architecture to fit your requirements&lt;/li&gt;
&lt;li&gt;Amazon EBS for fault-tolerant storage for data and logs.&lt;/li&gt;
&lt;li&gt;For demanding workloads, you can use Amazon EBS Provisioned IOPS and specify the IOPS required.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Non-relational DBs&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Amazon DynamoDB : Cloud-native solution with all AWS goodness out-of-the-box.&lt;/li&gt;
&lt;li&gt;Amazon DocumentDB : Ready for JSON data at scale. Compatible with MongoDB&lt;/li&gt;
&lt;li&gt;Amazon KeySpace : Full compatibility with Apache Cassandra&lt;/li&gt;
&lt;li&gt;Amazon Neptune : Reliable and fully managed graph DB.&lt;/li&gt;
&lt;li&gt;Amazon QLDB (Quantum Ledger DB) : Fully managed ledger DB with transparent, immutable and cryptographically verifiable transaction log owned by a central authority.&lt;/li&gt;
&lt;li&gt;Amazon Timestream : Server less time series DB for IoT and operational applications.&lt;/li&gt;
&lt;li&gt;You may use EC2 to host any other non-relational DB you're working with&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Storage and backups&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Use Amazon S3 for static storage like files and media.&lt;/li&gt;
&lt;li&gt;Use Amazon EBS as attachable storage volumes with EC2 instances.&lt;/li&gt;
&lt;li&gt;EBS runs in a different lifecycle from that of the instance it's attached to.&lt;/li&gt;
&lt;li&gt;You can take a snapshot of an EBS volume and store it on S3. Since the changes only are stored, more frequent snapshot will decrease snapshot time&lt;/li&gt;
&lt;li&gt;EBS goes as large as 16TB and the ability to stripe volumes for increased IO performance.&lt;/li&gt;
&lt;li&gt;Use EBS Provisioned IOPS to meet the needs of your IO-intensive workloads - 16k (all instance types) to 64k (Nitro systems) and io2 block express volume type for up to 256k IOPS and max storage 64TB&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Automatic Scaling&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Use Auto Scaling alone with CloudWatch and Amazon ELB (Elastic Load Balancer) to scale up/down/in/out your fleet automatically based on monitoring-based results.&lt;/li&gt;
&lt;li&gt;Use Auto Scaling groups to scale different layers of the application independently.&lt;/li&gt;
&lt;li&gt;You can also scale EC2 instances manually using the EC2 API&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Additional Security Features&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;The large scale of the AWS network helps protect you against DDoS attacks via scaling up your app in response to the large traffic using ELB, CloudFront and Route53&lt;/li&gt;
&lt;li&gt;AWS Shield : Managed service that protects you against various forms of the DDoS attacks. It's standard offering is free and active in your account and protects against common attacks. The advanced offering provides you with a near-real-time visibility into tha attack, integration with other services and the ability to access the AWS DDoS Response Team for large-scale sophisticated attacks.&lt;/li&gt;
&lt;li&gt;AWS WAF (Web app framework) : Works with CloudFront of Application Load Balancer to protect your apps against XSS, SQL injection and DDoS attacks. Also comes with a fully featured API helping your in automation.&lt;/li&gt;
&lt;li&gt;AWS Firewall Manager : Centrally configure and manage firewall rules across your accounts and applications in &lt;strong&gt;AWS Organizations&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Failover&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Availability Zones are physically separated locations for app redundancy and fault-tolerance. It's recommended to deploy your EC2 instances in multiple AZs. You should make sure that distribution of provisions among AZs guarantees high availability and consistency, which is already managed for you in most of AWS.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key considerations on using AWS for web app hosting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  No more physical appliances
&lt;/h3&gt;

&lt;p&gt;No more HW firewalls, routers, load balancer with your AWS Cloud architecture, just SW solutions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Firewalls everywhere
&lt;/h3&gt;

&lt;p&gt;Every host is locked down with a firewall. You should analyze traffic between hosts within your architecture to determine which ports needs to be open and create security groups in accordance. You can use network access control lists within Amazon VPC for subnet-level lockdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consider the availability of multiple Datacenters
&lt;/h3&gt;

&lt;p&gt;Think of AZs within an AWS region as separate Datacenters, logically and physically separated. You can use Amazon VPC to keep your resources in the same logical network while leveraging AZs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Threat hosts as ephemeral and dynamic
&lt;/h3&gt;

&lt;p&gt;No assumption on the host IP, location, ever-lasting availability of the host. Your key to fault-tolerance and high scalability of your apps is the dynamic design that fits with the wild nature of the cloud world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consider containers and serverless
&lt;/h3&gt;

&lt;p&gt;Consider modernizing your application using Containers and Serveless technologies, leveraging services like AWS Fargate and AWS Lambda for more agile apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consider automated deployment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Lightsail : Simple app development VPS with everything needed to build a Web app or website. Ideal for simple workloads and quick deployments.&lt;/li&gt;
&lt;li&gt;AWS Elastic Beanstalk : Easy-to-use service for deploying and scaling web apps developed with most of the technologies (Ruby, NodeJS, Docker,..) on familiar servers (Apache, NGINX, ..)&lt;/li&gt;
&lt;li&gt;AWS App Runner : Quickly deploy your containerise Web apps at scale effortlessly and without prior infrastructure knowledge required.&lt;/li&gt;
&lt;li&gt;AWS Amplify : Framework of tools and services to help front-end web and mobile developers to build scalable products with an AWS-powered backend. Also used for deploying static web apps.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Migration to an AWS cloud architecture requires some consideration and changes, but really pays off.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>Amazon Aurora MySQL Database Administrator’s Handbook</title>
      <dc:creator>Ebrahim Gomaa</dc:creator>
      <pubDate>Tue, 24 Aug 2021 10:37:46 +0000</pubDate>
      <link>https://dev.to/awsmenacommunity/amazon-aurora-mysql-database-administrator-s-handbook-146d</link>
      <guid>https://dev.to/awsmenacommunity/amazon-aurora-mysql-database-administrator-s-handbook-146d</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Aurora MySQL is a managed relational DB engine compatible with MySQL 5.6 &amp;amp; 5.7. You can still use the drivers, connectors and tools you used to with MySQL with (almost) no charge. Aurora MySQL DB clusters provides features like :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One primary Read/Write (RW) instance, 15 replicas of Read-only (RO) instances&lt;/li&gt;
&lt;li&gt;Any RO instance can be promoted to RW in case of failure of the primary instance&lt;/li&gt;
&lt;li&gt;Dynamic cluster endpoint (i.e. URI or address) always pointing to the primary instance even in case of failover&lt;/li&gt;
&lt;li&gt;Reader endpoint including all RO Replicas, updates when replicas are added or removed&lt;/li&gt;
&lt;li&gt;Admin can create custom DNS endpoints containing his own configuration of DB instances within a single cluster&lt;/li&gt;
&lt;li&gt;Improved scalability using internal connection pools and thread multiplexing for each server&lt;/li&gt;
&lt;li&gt;Almost zero-down-time DB restart/recovery&lt;/li&gt;
&lt;li&gt;Almost Real-Time metadata accessible by application developers enabling them to create smart drivers and connect directly to the instances based on their roles (RW - RO)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But to get the most out of these perks, DBAs need to learn the best practices, because any sub-optimal configuration for applications, drivers, connector or proxies can lead to unexpected downtime and performance issues. And you can consider this article &lt;em&gt;The Aurora MySQL configuration best practices Cookbook.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DNS Endpoints
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocs.aws.amazon.com%2FAmazonRDS%2Flatest%2FAuroraUserGuide%2Fimages%2FAuroraArch001.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdocs.aws.amazon.com%2FAmazonRDS%2Flatest%2FAuroraUserGuide%2Fimages%2FAuroraArch001.png" alt="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/AuroraArch001.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/AuroraArch001.png" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/AuroraArch001.png&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you can see from the diagram above, Aurora DB has some &lt;em&gt;Compute&lt;/em&gt; instances connected to a Multi-tenant (can serve many clusters), Multi-attach (can have multiple instances attached to it) &lt;em&gt;Storage&lt;/em&gt; volume. The compute instances are one primary RW instance (M) and up to 15 RO replicas (R) - per cluster. RO instances can take over the RW instance in case of failure.&lt;/p&gt;

&lt;p&gt;But how to connect to these instances in an optimum way ? Here, Aurora supports 4 types of DNS endpoint.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cluster Endpoint&lt;/strong&gt; : Following the Primary Instance even in case of failover&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reader Endpoint&lt;/strong&gt; : Include all RO instances under a single DNS CNAME, so can be used for Round-robin Load Balancing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instance Endpoints :&lt;/strong&gt; Connect directly to some instance (RW or RO)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Endpoints :&lt;/strong&gt; User-defined DNS endpoints containing a selected group on instance within a single cluster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use any of the 4 types where you see suitable to reach the optimum configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connection Handling in Aurora MySQL and MySQL
&lt;/h3&gt;

&lt;p&gt;MySQL Community Edition dedicated one OS thread from the &lt;code&gt;mysqld&lt;/code&gt; process for each connection (one-thread-per-connection). This leads to many scalability issues (in case of large number of user connections) like high memory usage even if some connections are idle, also the huge context-switching overhead between multiple threads.&lt;/p&gt;

&lt;p&gt;As a solution, Aurora MySQL supports a thread pool approach (group of threads ready for any connection on-demand usage). Those threads are never dedicated to any single connection usage. Threads are multiplexed, that is, when a thread is being used by a connection and it's not actively executing (e.g. waiting for IO), the thread can switch to another connection to do useful work; thus gaining best utilization and serving many connections with just a few threads. The thread pool also scales up and down automatically according to usage, no manual configuration required.&lt;/p&gt;

&lt;p&gt;Although thread pooling reduces server-side cost of maintaining connections, it comes with the limitation of setting up and terminating the connections, especially when this connection has session-level configuration (like &lt;code&gt;SET variable_name = value&lt;/code&gt; ). This process involves an exchange of several network packets. For busy workloads with short-lived connections (like Online Transaction Processing), consider using an application-side connection pool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Misconceptions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;❌ &lt;strong&gt;No need for application-side connection pool when a server-side connection pool is used&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As mentioned before, server-side pooling has the limitation that it doesn't eliminate the overhead of setting up and terminating the connection. So if your application is doing very frequent opening/closing connections, and few statements are executed per connection; then you need application-side pooling. Even if your connections are long-lived, you may benefit from app-side pooling to avoid large bursts of new connection attempts i.e. connection surges. You can use &lt;code&gt;tcpdump&lt;/code&gt; tool to monitor your connection and compare overhead packets versus useful processing packets to help you take the decision.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;❌ &lt;strong&gt;Idle connections don't use memory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Incorrect! Both OS and database processes allocate in-memory descriptors for each connection. Although Aurora MySQL typically uses less memory than MySQL CE, this overhead in Aurora MySQL is non-zero. So basically, avoid opening too more connection inn your app-side pool than you need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;❌ &lt;strong&gt;Downtime depends entirely on DB stability and features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Incorrect! Your app design and configuration also matters. For this, read the next section to know how your practices can help user traffic recover faster following a DB event.&lt;/p&gt;
&lt;h3&gt;
  
  
  Best Practices
&lt;/h3&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Using Smart Drivers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although Aurora MySQL &lt;em&gt;Cluster&lt;/em&gt; and &lt;em&gt;Reader&lt;/em&gt; endpoints abstracts (hides) the topology of the cluster, taking the topology into account while designing your connector helps greatly in eliminating delays occur because of DNS updates. For this reason, Aurora MySQL provides a near-real-time Metadata table ( &lt;code&gt;INFORMATION_SCHEMA.REPLICA_HOST_STATUS&lt;/code&gt; ) carrying information about the instances in the cluster and their roles and can be queried from any instance in the cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo40kasvij2k2v4575c8y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo40kasvij2k2v4575c8y.png" alt="replica_host_status table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Example query against the metadata table. Source : the original paper&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Smart drivers&lt;/em&gt;  are drivers/connector that utilize this table to improve queries, not only depending on high-level DNS endpoint, also round-robin load-balancing read-only connections to the reader instances. Example for this is The MariaDB Connector/J for Java.&lt;/p&gt;

&lt;p&gt;Note that using the smart connector doesn't compensate for the rest of best practices, you still need to manage some other stuff - following in the article - to reach to the optimal connection. Also note that theses connector that has Aurora-specific features may not be officially verified by AWS and needs to be up-to-date as they encounter much more updates than the barebones connectors. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DNS Caching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rule of thumb: DNS Caching TTL of Aurora endpoints is 5 seconds.&lt;/strong&gt; Your configuration should NEVER further exceed this limit. Caching may occur on network layer, the OS or your application, so make sure all caching layers will not exceed the TTL limit.&lt;br&gt;
Exceeding the TTL limit means having outdated DNS data, which may lead to reaching to a demoted primary instance as if it is still the primary instance, connection failure to the reader instances after scaling up/down due to usage of old IPs or unequal utilization of traffic among reader instances.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Connection management and pooling&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always keep the connections closed and don't rely on the development language/framework to close them automatically as there may be scenarios where this is not the case.&lt;/li&gt;
&lt;li&gt;If you can't rely on client-interactive applications to close idle connection use &lt;a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_interactive_timeout" rel="noopener noreferrer"&gt;&lt;code&gt;interactive_timeout&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout" rel="noopener noreferrer"&gt;&lt;code&gt;wait_timeout&lt;/code&gt;&lt;/a&gt; MySQL variables to keep idle connection wait time suitable.&lt;/li&gt;
&lt;li&gt;As mentioned before, use connection pooling to protect your DB against surges, also if you make thousands of short-lived connections per second. If your framework doesn't support connection pooling, mind using connection proxies like ProxySQL.&lt;/li&gt;
&lt;li&gt;Best practices with managing connection pools and proxies :

&lt;ul&gt;
&lt;li&gt;Check the health of the borrowed connection before using. This can be as easy as &lt;code&gt;SELECT 1&lt;/code&gt; or show the value of &lt;code&gt;@innodb_read_only&lt;/code&gt; variables to further know the role of the Aurora instance you're communicating with - &lt;code&gt;true&lt;/code&gt; if it's a reader instance.&lt;/li&gt;
&lt;li&gt;Periodically health-check the connections&lt;/li&gt;
&lt;li&gt;Recycle ALL connections periodically by closing and reopening new ones. This helps save resources and prevent &lt;a href="https://stackoverflow.com/questions/587965/what-is-runaway-query" rel="noopener noreferrer"&gt;runaway queries&lt;/a&gt; and zombie connections (connection with abandoned clients).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Connection Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scaling up, number of connections increases proportional to number of application server instances, given that you dedicated a fixed number of connections per server. This may limit DB scalability in some extreme cases, as most of the connections are typically idle, yet taking up server resources.&lt;/p&gt;

&lt;p&gt;To solve this case you may reduce number of connections per server to the minimum applicable, although this solution doesn't scale well as your app grows up. A much better solution is to use proxy between the application servers and the DB. It comes with many features out of the box, like configurable fixed number of connections, query caching, connection buffering and load balancing. Proxies like ProxySQL, ScaleArc and MaxScale are compatible with MySQL protocol. For further scalability and availability you may use multiple proxy instances behind the same DNS endpoint.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Transaction Management and Autocommit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Autocommit mode ensures that every statement runs in its own transaction which is commited automatically. This mode is recommended because disabling this mode means that the transaction is open and may stay open for long, blocking garbage collection mechanism and filling the garbage collection backlog, leading to excessive storage consumption and query slowness.&lt;/p&gt;

&lt;p&gt;It's recommended to always use the autocommit mode and double-check it's enabled in the applications and the DB sides, especially at the applications as it may not be enabled by default. You should also manage transactions manually using &lt;code&gt;START/BEGIN TRANSACTION&lt;/code&gt; and &lt;code&gt;COMMIT/ROLLBACK&lt;/code&gt; as soon as you finish. These recommendations apply whenever you're using innoDB.&lt;/p&gt;

&lt;p&gt;Also you can monitor transaction time using &lt;code&gt;information_schema.innodb_trx&lt;/code&gt; table. &lt;code&gt;trx_started&lt;/code&gt; is the starting time of the transaction so you can use it to calculate its age and investigate it if age is in the order of minutes.&lt;/p&gt;

&lt;p&gt;For garbage collection backlog monitoring, use &lt;code&gt;trx_rseg_history_len&lt;/code&gt; counter in the &lt;code&gt;information_schema.innodb_metrics&lt;/code&gt; table. If in the order of ten thousands, g.c. is delayed. If millions, the situation is dangerous and needs investigate.&lt;/p&gt;

&lt;p&gt;Note that garbage collection in Aurora is cluster-wide, meaning that any performance issue will affect all the instances, so you need to monitor all the instances.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Connection Handshakes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually opening a new DB session involve executing many set up statements, like setting up session variables, which affects greatly the applications sensitive to latency. You should be aware of internal operations of the driver using Aurora Advanced Audit, General Query Log or network-level packet trace using &lt;code&gt;tcpdump&lt;/code&gt;. You know the purpose of each statement and its effect on subsequent queries. If you find that number of roundtrips taken for handshake operations are significant relative to actual work, consider disabling some handshake statements or using connection pooling.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Load Balancing with the Reader Endpoint&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNS resolution of Reader endpoint is load balanced in round robin fashion for every new connection, this means that for the same connection, all the queries are executed against the same instance. This may lead to unequal usage of Read Replicas, long initial delay for newly added instances and applications keep sending traffic to stopped instances in case of DNS caching. Be sure to use DNS caching best practices mentioned before.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Designing for Fault Tolerance and Quick Recovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you scale your application up, you're more likely to add more instances (db, application, ...) also to face more issues. You should design your application to be resilient in facing these situations. You should keep your application up-to-date with the failover of Aurora primary instances (occurs within 30 seconds after the failure). You should also keep up to date with the new Reader instances created to start sending traffic to them, as well as the removed instances to stop sending traffic to them. Not following best practices may lead to longer downtime.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Server Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configuration Variable &lt;code&gt;max_connections&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This variable limits number of connections per Aurora DB instance. The best practice is to keep this slightly higher than what you expect to open, but beware if you're using &lt;code&gt;performance_schema&lt;/code&gt; as its memory usage increases proportional to the value of this variable, s it may lead to OOM isues on smaller instances, like T2 and T3 instances with less than 8GB memory. In this case you may need to disable &lt;code&gt;performance_schema&lt;/code&gt; or keep &lt;code&gt;max_connections&lt;/code&gt; to the default.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configuration Variable &lt;code&gt;max_connect_errors&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This variable controls number of successive failed connection requests for a given client host. The client is shown the following error on exceeding this limit&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Host &lt;span class="s1"&gt;'*host_name*'&lt;/span&gt; is blocked because of many connection 
errors ...
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;A common incorrect practice is keeping this variable very high to avoid client connectivity issues. However, this is dangerous as it may hide serious issues with the applications that needs developer action, or even worse, DDoS attacks trying to take down the system.&lt;/p&gt;

&lt;p&gt;If your client application is facing the "host is blocked" problem, use &lt;code&gt;aborted_connects&lt;/code&gt; diagnostic counters along with &lt;code&gt;host_cache&lt;/code&gt; table to &lt;strong&gt;identify and fix the problem&lt;/strong&gt; &lt;strong&gt;in your application.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Note that this variable has no effect if &lt;code&gt;skip_name_resolve&lt;/code&gt; is set to 1 (default).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Aurora is really great ❤️, however, you still need to apply best practices to ensure smooth integration, reduced downtime and scalability. This article will help you apply these best practices with little to no engineering effort.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>database</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
