{"id":521,"date":"2026-11-07T19:41:31","date_gmt":"2026-11-08T00:41:31","guid":{"rendered":"https:\/\/www.gworks-ec.com\/?p=521"},"modified":"2026-11-08T10:44:20","modified_gmt":"2026-11-08T15:44:20","slug":"diseno-de-una-arquitectura-web-escalable-y-de-alta-disponibilidad-en-aws-de-una-instancia-de-computo-a-cloudfront-alb-y-auto-scaling","status":"publish","type":"post","link":"https:\/\/www.gworks-ec.com\/en\/2026\/11\/07\/diseno-de-una-arquitectura-web-escalable-y-de-alta-disponibilidad-en-aws-de-una-instancia-de-computo-a-cloudfront-alb-y-auto-scaling\/","title":{"rendered":"Designing a scalable, high-availability web architecture on AWS: From a single compute instance to CloudFront, ALB, and Auto Scaling"},"content":{"rendered":"<p class=\"wp-block-paragraph\">In the face of increasing traffic demand and intolerance of downtime, I share the technical rationale for migrating a monolithic instance as a single point of failure, to a <strong>resilient cloud-native architecture<\/strong>, and without failing in the attempt\u2014a key technical model for ensuring that applications scale in line with demand and automatically recover from potential failures or incidents involving hardware, software, or an Availability Zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using a single EC2 compute instance exposes organizations to three critical forms of unavailability:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Traffic spikes that overwhelm the processor (CPU).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Instance failures due to faulty deployments.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Dependency on a single Availability Zone (AZ).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This post describes a highly available, horizontally scalable architecture based on four core AWS components, designed to eliminate manual restarts and ensure business continuity. The proposed architecture is my own original work, developed based on my professional experience and aligned with established frameworks. <strong>AWS Well-Architected Framework<\/strong> and <strong>Architecture Best Practices<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1054\" height=\"1701\" src=\"https:\/\/www.gworks-ec.com\/nia\/uploads\/2026\/11\/imag.webp\" alt=\"\" class=\"wp-image-522\" srcset=\"https:\/\/www.gworks-ec.com\/nia\/uploads\/2026\/11\/imag.webp 1054w, https:\/\/www.gworks-ec.com\/nia\/uploads\/2026\/11\/imag-186x300.webp 186w, https:\/\/www.gworks-ec.com\/nia\/uploads\/2026\/11\/imag-635x1024.webp 635w, https:\/\/www.gworks-ec.com\/nia\/uploads\/2026\/11\/imag-7x12.webp 7w\" sizes=\"auto, (max-width: 1054px) 100vw, 1054px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Step 1 \u2014 Multi-AZ redundancy.<\/strong> <\/em>Distribution of the workload across two or more Availability Zones (physically separate data centers with independent power and network infrastructure); if one zone fails, the other continues to handle traffic without interruption.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Step 2 \u2014 Intelligent Routing (Application Load Balancer).<\/strong> <\/em>The ALB balancer acts as the single entry point (Layer 7 \u2013 HTTP\/HTTPS) distributing traffic through <strong>Path-Based Routing (PBR)<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Paths &nbsp;<code><strong>\/api\/*<\/strong>&nbsp;<\/code> towards the dynamic backend.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&nbsp;<code><strong>default (*)<\/strong>&nbsp;<\/code> towards the S3 bucket for static content.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Furthermore, they execute <em>health checks<\/em> continuous and carries out <strong>SSL Termination<\/strong> on the load balancer, centralizing certificate management.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Step 3 \u2014 Automated Elasticity (Auto Scaling Group).<\/strong> <\/em>Maintains operational capacity based on defined thresholds:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Minimum: 2<\/strong>, an instance by AZ.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Maximum: 4.<\/strong><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Desired: 2<\/strong>.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Target Tracking<\/strong>: CPU 60%.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Health Check Type: ELB<\/strong>, no EC2.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Grace Period: 300 seconds<\/strong> to allow startup time for the instances before evaluating them.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In the event of a failure, a replacement is deployed automatically, without human operator intervention.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Step 4 \u2014 Content download using CloudFront and Amazon S3.<\/strong> <\/em>CloudFront delivers static content from locations <em>edge<\/em> close to the user, caching copies. This way, files that reside in the private S3 bucket are accessible only through AWS CloudFront using <em>Origin Access Control<\/em> (OAC).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the other hand, it is proposed that dynamic routes for example\u00a0<code>\/api\/*\u00a0<\/code>are routed directly to the ALB load balancer, optimizing the costs and performance of the proposed architecture by separating static traffic from dynamic traffic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83c\udfaf Results and their applicability.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Based on the foregoing, the resulting AWS architecture design enables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Zero single points of failure,<\/strong> with active redundancy across multiple AZs.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Autonomous recovery,<\/strong> automatically detecting and replacing instances with incidents.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optimized performance,<\/strong> downloading static traffic to <em>edge<\/em> and latency reduction.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>On-demand scalability,<\/strong> horizontal growth controlled by business metrics, such as: RTO (Recovery Time Objective), RPO (Recovery Point Objective), MTTR (Mean Time to Repair), and MTBF (Mean Time Between Failures).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd <strong>Critical design best practices based on the pillars of the AWS Well-Architected Framework.<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure the <em>health check<\/em> of the Auto Scaling Group (ASG) in mode <strong>ELB<\/strong> and not just EC2\u2014to detect if the web application has frozen, even while the operating system remains active.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Implement an endpoint\u00a0<code>\/health\u00a0<\/code> lightweight, returning a 200 status without needing to query the database.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure appropriate thresholds and intervals; the ALB traffic-balancing service performs checks every 30 seconds and marks instances as unhealthy after 2 failures.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure that the Web application is strictly <em>stateless<\/em> (sessions externalized to ElastiCache or DynamoDB). in addition to implementing consumption alerts in <strong>AWS Budgets<\/strong> from day one, to maintain visibility and control over costs.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Path-Based Routing in CloudFront,<\/strong> configuring two sources in the distribution:<\/li>\n<\/ul>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>The S3 bucket for static content (default path)<\/li>\n<\/ol>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>The ALB load balancer for dynamic routing &nbsp;<code>\/api\/*&nbsp;<\/code>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This optimizes costs and the performance of the web application by separating static traffic from dynamic traffic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00bfDo you typically externalize user sessions in your web architectures, or do you still rely on local storage within your EC2 compute instances?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00bfWhat metric do you use as the primary trigger for executing your Auto Scaling policies\u2014for example, CPU, ALB Request Count, or custom metrics?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Technical references.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Amazon Web Services. <em>Regions and Availability Zones<\/em>. AWS Documentation. &nbsp;<a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-regions-availability-zones.html\">https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-regions-availability-zones.html&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Amazon Web Services. <em>What is an Application Load Balancer?<\/em> AWS Documentation. &nbsp;<a href=\"https:\/\/docs.aws.amazon.com\/elasticloadbalancing\/latest\/application\/introduction.html\">https:\/\/docs.aws.amazon.com\/elasticloadbalancing\/latest\/application\/introduction.html&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Amazon Web Services. <em>Health checks for your target groups<\/em>. AWS Documentation. &nbsp;<a href=\"https:\/\/docs.aws.amazon.com\/elasticloadbalancing\/latest\/application\/target-group-health-checks.html\">https:\/\/docs.aws.amazon.com\/elasticloadbalancing\/latest\/application\/target-group-health-checks.html&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Amazon Web Services. <em>What is Amazon EC2 Auto Scaling?<\/em> AWS Documentation. &nbsp;<a href=\"https:\/\/docs.aws.amazon.com\/autoscaling\/ec2\/userguide\/what-is-amazon-ec2-auto-scaling.html\">https:\/\/docs.aws.amazon.com\/autoscaling\/ec2\/userguide\/what-is-amazon-ec2-auto-scaling.html&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Amazon Web Services. <em>Restricting access to an Amazon S3 origin (OAC)<\/em>. AWS Documentation. &nbsp;<a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudFront\/latest\/DeveloperGuide\/private-content-restricting-access-to-s3.html\">https:\/\/docs.aws.amazon.com\/AmazonCloudFront\/latest\/DeveloperGuide\/private-content-restricting-access-to-s3.html&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>Ante la creciente demanda de tr\u00e1fico y la intolerancia a los tiempos de inactividad, comparto los fundamentos t\u00e9cnicos para migrar una instancia monol\u00edtica como punto \u00fanico de falla, a una arquitectura cloud-native resiliente, y no morir en el intento, un modelo t\u00e9cnico clave para garantizar que las aplicaciones crezcan de acuerdo con la demanda y, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.gworks-ec.com\/en\/2026\/11\/07\/diseno-de-una-arquitectura-web-escalable-y-de-alta-disponibilidad-en-aws-de-una-instancia-de-computo-a-cloudfront-alb-y-auto-scaling\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Dise\u00f1o de una arquitectura Web escalable y de alta disponibilidad en AWS: De una instancia de c\u00f3mputo a CloudFront, ALB y Auto Scaling&#8221;<\/span><\/a><\/p>","protected":false},"author":2,"featured_media":446,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,34,30,29,31,33],"tags":[27,25,28,22,24,23,26],"class_list":["post-521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alta-disponibilidad","category-architecture-best-practices","category-arquitectura","category-aws","category-devops","category-well-architected-framework","tag-altadisponibilidad","tag-arquitecturacloud","tag-autoscaling","tag-aws","tag-awscommunity","tag-cloudnative","tag-devops"],"_links":{"self":[{"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/posts\/521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/comments?post=521"}],"version-history":[{"count":8,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/posts\/521\/revisions"}],"predecessor-version":[{"id":535,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/posts\/521\/revisions\/535"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/media\/446"}],"wp:attachment":[{"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/media?parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/categories?post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gworks-ec.com\/en\/wp-json\/wp\/v2\/tags?post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}