<?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: Juhi Srivastava</title>
    <description>The latest articles on DEV Community by Juhi Srivastava (@juhisri02).</description>
    <link>https://dev.to/juhisri02</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3428111%2F5136f4ee-a253-4760-a8b7-548a7d54e3a9.png</url>
      <title>DEV Community: Juhi Srivastava</title>
      <link>https://dev.to/juhisri02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juhisri02"/>
    <language>en</language>
    <item>
      <title>Part 5: Decoupling and Background Jobs</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Wed, 30 Sep 2026 16:07:27 +0000</pubDate>
      <link>https://dev.to/juhisri02/part-5-decoupling-and-background-jobs-4ebl</link>
      <guid>https://dev.to/juhisri02/part-5-decoupling-and-background-jobs-4ebl</guid>
      <description>&lt;h2&gt;
  
  
  Building a Web App: A Beginner's Guide to Cloud Architecture (Part 5 of&amp;nbsp;5)
&lt;/h2&gt;

&lt;p&gt;In Part 1, our main server died, but our load balancer instantly shifted traffic to a backup (High Availability). In Part 2, 50,000 users rushed our registration page, and our infrastructure automatically cloned itself to handle the massive spike (Scalability). In Part 3, malicious actors tried to bypass our website, but our private networks and firewalls blocked them (Security). In Part 4, international users complained about lag, so we moved our static files to global edge networks to make the app lightning fast (Speed).&lt;/p&gt;

&lt;p&gt;We now have a highly available, endlessly scalable, secure, and blazing-fast web application.&lt;/p&gt;

&lt;p&gt;But there is one final bottleneck to overcome: &lt;strong&gt;Synchronous Processing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine our 50,000 users are now asked to upload a 2GB video portfolio to complete their registration. When a user clicks "Upload," our web server accepts the file and begins processing it. Because it is working synchronously, that specific web server is now completely locked up. For the next 10 minutes, it cannot handle any other requests.&lt;/p&gt;

&lt;p&gt;The user is left staring at a spinning loading wheel. If other users try to reach that same server, they are put on hold. Eventually, the browser times out, the connection drops, and the server crashes from memory exhaustion.&lt;/p&gt;

&lt;p&gt;To fix this, we need to separate the servers taking the requests from the servers doing the heavy compute. In cloud architecture, this is called Decoupling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Restaurant Analogy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of your web server as a waiter in a restaurant.&lt;br&gt;
A bad restaurant has the waiter take your order, walk into the kitchen, cook the meal themselves, and bring it back to you. While they are cooking, they can't help any other tables.&lt;/p&gt;

&lt;p&gt;A good restaurant uses a ticket system. The waiter takes your order, slaps a ticket onto a rail, and immediately goes back to serving other tables. The chefs in the kitchen look at the rail, pull the tickets one by one, and do the heavy lifting in the background.&lt;br&gt;
We need to build that ticket rail and hire some chefs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The Ticket Rail: Message&amp;nbsp;Queues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the cloud, the "ticket rail" is called a Message Queue. It is a simple, highly durable service that holds onto text messages (tickets) until a server is ready to read them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS provides Amazon SQS (Simple Queue Service&lt;/li&gt;
&lt;li&gt;Azure provides Azure Service Bus.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How the new flow works?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user uploads a video.&lt;/li&gt;
&lt;li&gt;The Web Server saves the raw video file to S3 (Object Storage).&lt;/li&gt;
&lt;li&gt;The Web Server drops a tiny text message into the SQS Queue saying: "Hey, there is a new video at this S3 link that needs processing. User ID is 45."&lt;/li&gt;
&lt;li&gt;The Web Server immediately replies to the user: "Thanks! We are processing your video and will email you when it's ready." The user is happy, the web server is instantly freed up to handle the next user, and the app remains lightning fast. &lt;strong&gt;But who actually processes the video?&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. The Chefs: Background Workers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We don't want our front-line Web Servers doing heavy compute. Instead, we spin up a completely separate, hidden group of resources called Workers.&lt;br&gt;
While you could use a second group of standard web servers (like EC2 or Azure VMs) for this, modern cloud teams usually use Containers or Serverless Functions because they are incredibly lightweight and can scale up in seconds rather than minutes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;AWS&lt;/strong&gt;: You might use AWS Fargate (Serverless Containers) or AWS Lambda.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Azure&lt;/strong&gt;: You would use Azure Container Apps or Azure Functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These Worker containers have one job: they constantly ask the Message Queue, "&lt;em&gt;Do you have any new tickets?&lt;/em&gt;"&lt;/p&gt;

&lt;p&gt;When a worker sees the message about the video, it picks it up, downloads the raw video from S3, spends 10 minutes processing it, saves the final version, and updates the Database to mark the job as "Complete."&lt;/p&gt;

&lt;p&gt;Because the Workers are completely decoupled, you can scale them based on the exact length of the queue. If there are 0 messages, you scale the containers down to zero so you pay nothing. If 1,000 users upload videos at once, the queue fills up, and the cloud provider instantly spins up 50 container apps to churn through the backlog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture Diagrams&lt;/strong&gt;&lt;br&gt;
Here is the final, fully decoupled architecture showing the Web Servers writing to the Queue, and the isolated Worker Servers reading from it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;AWS Final Architecture (SQS &amp;amp;&amp;nbsp;Workers)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ql8f2y7o810ibf7vm2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ql8f2y7o810ibf7vm2v.png" alt="AWS Final Architecture (SQS &amp;amp;&amp;nbsp;Workers)" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Azure Final Architecture (Service Bus &amp;amp;&amp;nbsp;Workers)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fesavo49kspi82arexm6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fesavo49kspi82arexm6u.png" alt="Azure Final Architecture" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading &amp;amp; Official Documentation&lt;/strong&gt;&lt;br&gt;
If you want to dive deeper into the concepts covered in this article, check out the official documentation from AWS and Microsoft:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Queues &amp;amp; Background Workers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon SQS:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html" rel="noopener noreferrer"&gt;What is Amazon Simple Queue Service?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Fargate:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html" rel="noopener noreferrer"&gt;What is AWS Fargate for Serverless Containers?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous Integration:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/modernization-integrating-microservices/async-messaging.html" rel="noopener noreferrer"&gt;Asynchronous messaging patterns in AWS&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure Queues &amp;amp; Background Workers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Azure Service Bus:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview" rel="noopener noreferrer"&gt;What is Azure Service Bus?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Container Apps:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/container-apps/overview" rel="noopener noreferrer"&gt;Azure Container Apps Overview&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous Messaging:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/messaging" rel="noopener noreferrer"&gt;Asynchronous messaging options in Azure&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That brings us to the end of our five-part journey into cloud architecture. We took a single, fragile web server and evolved it into a highly available, endlessly scalable, secure, fast, and fully decoupled enterprise application.&lt;/p&gt;

&lt;p&gt;If you found this series helpful and want to keep leveling up your engineering skills, be sure to follow for more such content!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>architecture</category>
      <category>azure</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Part 4: Storage, Speed, and Global Reach</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Tue, 22 Sep 2026 21:27:14 +0000</pubDate>
      <link>https://dev.to/juhisri02/part-4-storage-speed-and-global-reach-n</link>
      <guid>https://dev.to/juhisri02/part-4-storage-speed-and-global-reach-n</guid>
      <description>&lt;h2&gt;
  
  
  Building a Web App: A Beginner's Guide to Cloud Architecture (Part 4 of&amp;nbsp;5)
&lt;/h2&gt;

&lt;p&gt;Let's recap the journey so far.&lt;/p&gt;

&lt;p&gt;In Part 1, we made sure our app wouldn't crash if a server suddenly died (High Availability). In Part 2, we survived a massive 50,000-user traffic spike by teaching the app to automatically clone itself (Scalability). In Part 3, we built a digital fortress around the network to keep hackers out (Security).&lt;/p&gt;

&lt;p&gt;Our application is now an absolute tank. It is virtually unbreakable. But if we launch it right now, we are going to run into a completely different problem: It feels sluggish.&lt;/p&gt;

&lt;p&gt;Imagine that 50,000-user traffic spike hits again. Your servers scale up perfectly, and the app stays online. But every single time a user loads the homepage, your web servers are forced to process a heavy 5MB hero image, and your database has to recalculate the exact same "Top 10 Events" list. Doing that exact same math 50,000 times a minute is exhausting and incredibly expensive.&lt;/p&gt;

&lt;p&gt;To make matters worse, if your data center is in Virginia, a user trying to register from Tokyo is going to be staring at a blank screen for three seconds while the data physically travels across the Pacific Ocean.&lt;/p&gt;

&lt;p&gt;A secure and scalable app isn't necessarily a fast app.&lt;br&gt;
In Part 4, we are going to fix that. We will optimize our architecture by decoupling our storage, giving our database a short-term memory, and making the app load instantly for users anywhere in the world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Ephemeral Storage Problem (S3 &amp;amp; Blob&amp;nbsp;Storage)&lt;/strong&gt;&lt;br&gt;
In an auto-scaling environment, your web servers are "ephemeral." This means they are temporary. The cloud provider creates and destroys them dynamically based on traffic.&lt;/p&gt;

&lt;p&gt;Because of this, you can never treat a web server's hard drive as permanent storage. If a user uploads a profile picture and saves it directly to Web Server A, that picture will be permanently deleted the moment the traffic spike ends and the auto-scaler terminates Web Server A.&lt;/p&gt;

&lt;p&gt;To fix this, we must make our web servers stateless. Compute and storage need to be completely separated.&lt;br&gt;
Instead of saving files locally, the web server takes the user's uploaded file and pushes it to a centralized, infinitely scalable object storage bucket.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS calls this &lt;strong&gt;Amazon S3&lt;/strong&gt; (Simple Storage Service).&lt;/li&gt;
&lt;li&gt;Azure calls this &lt;strong&gt;Azure Blob Storage&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, it doesn't matter if you have two web servers or two hundred; they all read and write to the exact same centralized storage bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The Speed of Light Problem (Content Delivery Networks)&lt;/strong&gt;&lt;br&gt;
Moving our images and videos to Amazon S3 solves our storage problem, but it introduces a latency problem.&lt;/p&gt;

&lt;p&gt;Data travels fast, but it cannot break the speed of light. If your S3 bucket is located in a data center in Virginia, a user in Tokyo is going to experience a delay while that image travels across the Pacific Ocean.&lt;/p&gt;

&lt;p&gt;We solve this using a Content Delivery Network (CDN).&lt;br&gt;
A CDN is a massive global network of proxy servers located in hundreds of cities around the world (called Edge Locations). When you put a CDN in front of your storage bucket, it caches copies of your static files at these edge locations.&lt;/p&gt;

&lt;p&gt;When the user in Tokyo requests the profile picture, the request doesn't go all the way to Virginia. It goes to a CDN edge node in Tokyo, which serves the image in milliseconds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS calls its CDN &lt;strong&gt;Amazon CloudFront&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Azure calls its CDN &lt;strong&gt;Azure Front Door&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. The Database Bottleneck (In-Memory Caching)&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Static files (images, CSS, PDFs) are handled by the CDN, but what about dynamic data?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Reading from a relational database is a computationally expensive task because the database has to read from disk. If 10,000 users visit your homepage, and the homepage displays the "Top 10 Newest Articles," your web servers are going to ask the database for the exact same information 10,000 times. This is a massive waste of resources.&lt;/p&gt;

&lt;p&gt;We fix this by introducing a caching layer right in front of the database. Think of the cache as the database's short-term memory. It stores data in RAM, making it blisteringly fast to retrieve.&lt;br&gt;
When a user requests the homepage, the web server asks the cache first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cache Hit&lt;/strong&gt;: If the "Top 10 Articles" are in the cache, the cache returns them instantly. The database does no work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache Miss&lt;/strong&gt;: If the data isn't there, the web server queries the database, returns the articles to the user, and writes the result into the cache for the next user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The industry standard technology for this is Redis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS manages this for you with &lt;strong&gt;Amazon ElastiCache for Redis&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Azure provides &lt;strong&gt;Azure Cache for Redis&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture Diagram
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Azure Architecture Diagram&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi7jfthfm9gvhacoul0zs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi7jfthfm9gvhacoul0zs.png" alt="Azure Architecture Diagram" width="720" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Architecture Diagram&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbcmwxootagw9j2dxrzxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbcmwxootagw9j2dxrzxm.png" alt="AWS Architecture Diagram" width="720" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading &amp;amp; Official Documentation
&lt;/h2&gt;

&lt;p&gt;If you want to dive deeper into the concepts covered in this article, check out the official documentation from AWS and Microsoft:&lt;/p&gt;

&lt;h3&gt;
  
  
  References &amp;amp; Further Reading
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;AWS Storage &amp;amp; Caching&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html" rel="noopener noreferrer"&gt;Amazon Simple Storage Service (S3) Overview&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon CloudFront:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;What is Amazon CloudFront?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon ElastiCache:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/WhatIs.html" rel="noopener noreferrer"&gt;What is Amazon ElastiCache for Redis?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure Storage &amp;amp; Caching&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Azure Blob Storage:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction" rel="noopener noreferrer"&gt;Introduction to Azure Blob storage&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Front Door:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/frontdoor/front-door-overview" rel="noopener noreferrer"&gt;What is Azure Front Door?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Cache for Redis:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-overview" rel="noopener noreferrer"&gt;About Azure Cache for Redis&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Coming Up Next in Part 5:&lt;/strong&gt; The Unsung Hero of the Cloud (Decoupling)&lt;br&gt;
Our architecture is almost complete. We have solved for availability, scaling, security, and speed. But there is one final, critical piece of enterprise architecture left.&lt;br&gt;
What happens when a user triggers a massive background job, like uploading a 2GB video or initiating a script that sends 50,000 emails? If your web server tries to do this while the user waits, the app will freeze and the connection will time out.&lt;br&gt;
In our final installment, Part 5, we will introduce Message Queues (AWS SQS / Azure Service Bus) and Asynchronous Processing. We will learn how to decouple our architecture so our web servers can hand off heavy tasks to a hidden fleet of background worker servers, keeping the user interface fast and responsive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay Tuned!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Part 3: Security - Locking Down the Network</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Sun, 06 Sep 2026 22:12:53 +0000</pubDate>
      <link>https://dev.to/juhisri02/part-3-security-locking-down-the-network-4kga</link>
      <guid>https://dev.to/juhisri02/part-3-security-locking-down-the-network-4kga</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Building a Web App: A Beginner's Guide to Cloud Architecture (Part 3 of&amp;nbsp;5)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Alright, let's take a step back and look at what we've built so far.&lt;/p&gt;

&lt;p&gt;In Part 1, we made sure our app doesn't crash when a server dies (High Availability). In Part 2, we taught it how to automatically clone itself to handle a massive 50,000-user traffic spike (Scalability).&lt;/p&gt;

&lt;p&gt;But there's a critical flaw in our current setup: it is completely exposed to the internet.&lt;/p&gt;

&lt;p&gt;If your application servers and databases are sitting on the public web, anyone can try to connect to them. You don't want a random script or a malicious user bypassing your web interface to brute-force your database.&lt;/p&gt;

&lt;p&gt;To fix this, we need to take our infrastructure off the public internet and lock it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Private Network (VPCs &amp;amp;&amp;nbsp;VNets)
&lt;/h2&gt;

&lt;p&gt;When you spin up a server in the cloud, you shouldn't just drop it into the public ether. You need to put it inside a private, isolated network boundary.&lt;/p&gt;

&lt;p&gt;Think of this like buying a private plot of land and putting a fence around it. Everything inside the fence can talk to each other, but the outside world doesn't even know it exists.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS calls this a Virtual Private Cloud (VPC).&lt;/li&gt;
&lt;li&gt;Azure calls this a Virtual Network (VNet).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once your database and servers are inside this private network, they are safe from direct outside access. But obviously, legitimate users still need a way to reach the website. That's where subnets come in.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Zoning the Network: Public vs. Private&amp;nbsp;Subnets
&lt;/h2&gt;

&lt;p&gt;You need to divide your private network into different zones, called Subnets. The easiest way to visualize this is by looking at a bank. The lobby is public - anyone can walk through the front doors. The vault is private, and getting to it requires going through security.&lt;br&gt;
We structure our cloud network the exact same way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Public Subnet (The Lobby)&lt;/strong&gt;: This subnet has a route to the internet. We put our Load Balancer here. It faces the public web, accepts user traffic, and routes it backward.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Private Subnet (The Vault)&lt;/strong&gt;: This subnet is completely cut off from the internet. We put our Web Servers and Database here.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the web servers and database live in the private subnet, nobody on the internet can reach them directly. The only way traffic can get to your web servers is if it passes through the load balancer first.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Security&amp;nbsp;Groups
&lt;/h2&gt;

&lt;p&gt;Just because we forced traffic through the load balancer doesn't mean our job is done. We still need to define strict rules about which resources are allowed to talk to each other inside the network.&lt;br&gt;
We do this by attaching firewalls directly to our resources.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS&lt;/strong&gt; calls these Security Groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure&lt;/strong&gt; calls these Network Security Groups (NSGs).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The default rule for cloud security is the principle of least privilege: &lt;em&gt;&lt;strong&gt;deny all traffic, and only explicitly allow what is required&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How we configure the firewall rules for our architecture?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Load Balancer Firewall&lt;/strong&gt;: Allow incoming HTTP/HTTPS traffic from Anywhere (the internet).&lt;/li&gt;
&lt;li&gt;Web Server Firewall: Deny everything, except traffic coming directly from the Load Balancer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Firewall&lt;/strong&gt;: Deny everything, except traffic coming directly from the Web Servers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If an attacker somehow compromises the load balancer and tries to send a command straight to the database, the database's firewall will check the origin, see that it isn't a web server, and immediately drop the connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Deep Inspection: Web Application Firewalls (WAF)
&lt;/h2&gt;

&lt;p&gt;While Security Groups are essential, they have a blind spot. They only check where traffic is coming from and what port it's using (like a bouncer checking an ID). They don't look at the actual data being sent.&lt;/p&gt;

&lt;p&gt;If a hacker acts like a normal user but types a malicious database command into your website's login box, the Security Group will let it through because it registers as valid web traffic.&lt;/p&gt;

&lt;p&gt;To stop this, we need a Web Application Firewall (WAF) attached directly to the load balancer. If the Security Group is the bouncer checking IDs, the WAF is the metal detector inspecting the payload. It reads HTTP requests line by line. If it spots a common attack - like an SQL injection or Cross-Site Scripting (XSS) - the WAF drops the connection before it ever reaches your web servers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS&lt;/strong&gt;: You attach AWS WAF to your Application Load Balancer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure&lt;/strong&gt;: You attach the Azure Web Application Firewall to your 
Application Gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS Architecture Diagram&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzb18n7btgodw6wd3ixxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzb18n7btgodw6wd3ixxi.png" alt="AWS Architecture Diagram" width="688" height="971"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Architecture Diagram&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqviayzypld3b08chekmh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqviayzypld3b08chekmh.png" alt="Azure Architecture Diagram" width="800" height="1129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References &amp;amp; Further&amp;nbsp;Reading
&lt;/h2&gt;

&lt;p&gt;If you want to dive deeper into the concepts covered in this article, check out the official documentation from AWS and Microsoft:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Security &amp;amp; Networking&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon VPC:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html" rel="noopener noreferrer"&gt;What is Amazon VPC?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html" rel="noopener noreferrer"&gt;Control traffic to your AWS resources using security groups&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS WAF:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/how-aws-waf-works.html" rel="noopener noreferrer"&gt;How AWS WAF works&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure Security &amp;amp; Networking&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Azure Virtual Networks (VNets):&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview" rel="noopener noreferrer"&gt;What is Azure Virtual Network?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Security Groups (NSGs):&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview" rel="noopener noreferrer"&gt;Network security groups - Azure Virtual Network&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure WAF:&lt;/strong&gt; &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/ag-overview" rel="noopener noreferrer"&gt;What is Azure Web Application Firewall?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Coming Up Next in Part 4: Speed, Storage, and Global Reach&lt;/strong&gt;&lt;br&gt;
Our application is now highly available, scalable, and secure. However, forcing our web servers to process heavy image files and run repetitive database queries for every single user is slow and expensive.&lt;br&gt;
In Part 4, we will focus on taking the heavy lifting off our compute layer and making the app load instantly for users anywhere in the world. We will cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Object Storage (Amazon S3 / Azure Blob Storage)&lt;/strong&gt;: Why you should never save user uploads directly to a web server, and how to use infinite cloud storage instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Delivery Networks (AWS CloudFront / Azure Front Door)&lt;/strong&gt;: How to cache those stored files globally so they load in milliseconds, no matter where your users are located.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Caching (Amazon ElastiCache / Azure Cache for Redis)&lt;/strong&gt;: How to give your database a "short-term memory" so it stops doing the same heavy lifting twice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stay Tuned!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>azure</category>
      <category>security</category>
    </item>
    <item>
      <title>Part 2: Scalability — How to Survive a Massive Traffic Spike?</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Sun, 23 Aug 2026 13:49:28 +0000</pubDate>
      <link>https://dev.to/juhisri02/part-2-scalability-how-to-survive-a-massive-traffic-spike-1842</link>
      <guid>https://dev.to/juhisri02/part-2-scalability-how-to-survive-a-massive-traffic-spike-1842</guid>
      <description>&lt;h2&gt;
  
  
  Series: Building a Web App: A Beginner’s Guide to Cloud Architecture (Part 2 of 5)
&lt;/h2&gt;

&lt;p&gt;In Part 1, we made our Web App &lt;strong&gt;Highly Available&lt;/strong&gt;. If a server breaks, our load balancer silently shifts traffic to a backup. We don't have to worry about our app going offline due to a hardware failure.&lt;/p&gt;

&lt;p&gt;But what if your app doesn't crash from a failure, but from &lt;strong&gt;success&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;Imagine it is the final day of registration for your event. Suddenly, 50,000 users hit your website at the exact same time. Your two baseline servers max out their CPU, run out of memory, and the system grinds to a halt. &lt;/p&gt;

&lt;p&gt;We are going to fix that by making our infrastructure &lt;strong&gt;scalable&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scaling Up vs. Scaling Out
&lt;/h2&gt;

&lt;p&gt;When a server runs out of computing power, you have two choices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Vertical Scaling (Scaling Up)&lt;/strong&gt;: You turn off the server, buy a bigger processor, add more RAM, and turn it back on. It is easy to understand, but it requires downtime. Eventually, you hit a limit—you can only buy a computer so big.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal Scaling (Scaling Out)&lt;/strong&gt;: Instead of making one server bigger, you dynamically add more servers. If two servers handle 10,000 users, we can automatically spin up eight more servers to handle 50,000 users.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the modern cloud, Horizontal Scaling is the gold standard because it is elastic. When the traffic goes down, we delete the extra servers so we stop paying for them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Does Auto-Scaling Actually Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When your system decides it needs more power, there isn't a person in a data center running over to plug in a new machine. It is entirely automated. Here is what happens when traffic spikes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;The Alarm&lt;/strong&gt;: A monitoring service notices your servers are struggling (e.g., CPU has been sitting at 80% for three minutes). It sends an alert.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Blueprint&lt;/strong&gt;: The Auto Scaler looks at a "Blueprint" you provided earlier. This blueprint contains the exact operating system, application code, and settings needed to run your app perfectly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Clone&lt;/strong&gt;: The cloud provider instantly provisions brand new resources using that exact blueprint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Introduction&lt;/strong&gt;: Once the new servers or containers finish booting up, the Auto Scaler introduces them to the Load Balancer. The Load Balancer immediately starts sending user traffic to them, lowering the CPU usage across the board.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Setting the Rules (Scaling Policies)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Three rules you need to configure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Scale-Out Rule (When to add)&lt;/strong&gt;: "If average CPU usage goes over 75% for 3 minutes, add 2 servers." This protects the application from crashing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Scale-In Rule (When to remove)&lt;/strong&gt;: "If average CPU usage drops below 30% for 5 minutes, remove 2 servers." This protects your wallet when everyone goes to sleep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Cooldown Period&lt;/strong&gt;: A mandatory waiting period (e.g., 5 minutes) after a scaling event happens. This stops the system from panicking and adding 10 servers all at once before the first new server has even finished booting up.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The Architecture Blueprint&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both major cloud providers have dedicated services that monitor your traffic and automatically create or destroy servers based on the rules you set.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Compute Type&lt;/th&gt;
&lt;th&gt;AWS Service&lt;/th&gt;
&lt;th&gt;Azure Service&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Raw Servers (IaaS)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Auto Scaling Group (ASG)&lt;/td&gt;
&lt;td&gt;Virtual Machine Scale Sets (VMSS)&lt;/td&gt;
&lt;td&gt;Legacy apps or deep OS-level control.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Web Apps (PaaS)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Elastic Beanstalk&lt;/td&gt;
&lt;td&gt;Azure App Service&lt;/td&gt;
&lt;td&gt;Traditional web apps where you just want to upload code.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Simple Containers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;AWS Fargate (Standalone)&lt;/td&gt;
&lt;td&gt;Azure Container Instances (ACI)&lt;/td&gt;
&lt;td&gt;Quick, single-task container execution without complex scaling.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Container Scaling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ECS / EKS with Fargate&lt;/td&gt;
&lt;td&gt;Azure Container Apps (ACA)&lt;/td&gt;
&lt;td&gt;Modern microservices that need to auto-scale instantly (even down to zero).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: An Auto Scaling Group (ASG) is specifically built to manage EC2 instances (which is AWS's official name for raw virtual servers).&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Diagram
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS Architecture Diagram&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Good to know stuff about AWS:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
According to the official Amazon EC2 Auto Scaling documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a scaling action occurs, Amazon EC2 Auto Scaling automatically maintains balance across all of the Availability Zones that you specify.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When a scale-out event happens,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Amazon EC2 Auto Scaling does this by attempting to launch new instances in the Availability Zone with the fewest instances.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because our Auto Scaling Group spans two Availability Zones, AWS strictly enforces a 'balanced distribution' rule. If we tell it to add 2 instances, it looks at our zones and says, 'AZ 1 has one server, and AZ 2 has one server.' It will launch the first new server in AZ 1, and then launch the second new server in AZ 2 to ensure the high-availability balance remains perfectly intact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Architecture Diagram&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdr6ckmw2lsa0e3numlff.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdr6ckmw2lsa0e3numlff.png" alt="Azure Architecture Diagram" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Good to know stuff about Microsoft Azure:&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
A single VMSS(Virtual Machine scale set) can span across multiple Availability Zones, as long as those zones are inside the same Region.&lt;/p&gt;

&lt;p&gt;If you build a VMSS in the "&lt;strong&gt;East US&lt;/strong&gt;" region, you can tell Azure to spread your virtual machines across AZ 1, AZ 2, and AZ 3.&lt;/p&gt;

&lt;p&gt;Because our Virtual Machine Scale Set (VMSS) in above diagram spans two Availability Zones, Azure enforces a 'zone balancing' rule. If we tell it to add 2 instances, it looks at our zones and says, 'AZ 1 has one server, and AZ 2 has one server.' It will launch the first new virtual machine in AZ 1, and then launch the second new virtual machine in AZ 2 to ensure the high-availability balance remains perfectly intact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading &amp;amp; Official Documentation&lt;/strong&gt;&lt;br&gt;
If you want to dive deeper into the concepts covered in this article, check out the official documentation from AWS and Microsoft:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Auto Scaling Group Benefits (Multi-AZ):&lt;/strong&gt;&lt;a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Auto Scaling Availability Zone Distribution (Balancing):&lt;/strong&gt;
&lt;a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-availability-zone-balanced.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-availability-zone-balanced.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure VMSS and Availability Zones (Zone-Spanning):&lt;/strong&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Monitor Autoscale Best Practices:&lt;/strong&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-best-practices" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-best-practices&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Coming Up Next in Part 3&lt;/strong&gt;: Locking Down the Castle (Networking &amp;amp; Security)&lt;br&gt;
So far, we have built an application that is unbreakable (High Availability) and unstoppable (Scalability). But right now, we have a massive blind spot: &lt;strong&gt;Security&lt;/strong&gt;.&lt;br&gt;
If 50,000 legitimate users can easily reach our web servers, what is stopping a malicious hacker from trying to access our database directly?&lt;/p&gt;

&lt;p&gt;Stay tuned as we take our cloud architecture from highly scalable to highly secure!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>azure</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>Part 1: High Availability — How to Keep Your Application Online When Servers Fail?</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Thu, 20 Aug 2026 21:30:40 +0000</pubDate>
      <link>https://dev.to/juhisri02/part-1-high-availability-how-to-keep-your-application-online-when-servers-fail-2bfo</link>
      <guid>https://dev.to/juhisri02/part-1-high-availability-how-to-keep-your-application-online-when-servers-fail-2bfo</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Series&lt;/strong&gt;: Building a Web&amp;nbsp;App: A Beginner's Guide to Cloud Architecture (Part 1 of 5)
&lt;/h2&gt;

&lt;p&gt;In this 5-part series, we are building a cloud-based application designed to handle high-stakes user registrations and critical data submissions. We will explore how to make it reliable, scalable, secure, and cost-effective using &lt;strong&gt;AWS&lt;/strong&gt; and &lt;strong&gt;Azure&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Story: A Server Goes Down&lt;/strong&gt;&lt;br&gt;
Imagine your application is processing user registrations for a massive event with a strict midnight deadline. Thousands of people are filling out their forms and submitting their details at the same time.&lt;/p&gt;

&lt;p&gt;At 11:30 PM, the physical computer running the application experiences a hardware fault and turns off.&lt;/p&gt;

&lt;p&gt;The website throws an error, form submissions stop working, and users are left stranded. For any business critical application, this kind of &lt;strong&gt;downtime&lt;/strong&gt; is unacceptable.&lt;/p&gt;

&lt;p&gt;So, how do we make sure our application stays online even when hardware breaks?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem: The Single Point of Failure (SPOF)&lt;/strong&gt;&lt;br&gt;
When building a new app, most people start with the simplest setup: one virtual server running the website and the database together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm86g3cbhq7aswanbjke0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm86g3cbhq7aswanbjke0.png" alt="This is an image showing simplest setup with one virtual machine running the website and the database together." width="639" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt; - This is cheap and quick.&lt;br&gt;
&lt;strong&gt;Cons&lt;/strong&gt; - It creates a Single Point of Failure (SPOF). If that single server crashes, loses power, or loses its internet connection, everything stops working until someone manually logs in and restarts it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Don't Put All Your Eggs in One Basket&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In cloud computing, we assume hardware will fail eventually. Instead of hoping a server never breaks, we design the system to automatically recover when it does. This concept is called High Availability (HA).&lt;/p&gt;

&lt;p&gt;To achieve this, we use two fundamental building blocks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Availability Zones (AZs)&lt;/strong&gt;: Cloud providers group their physical data centers into regions. Inside each region, there are multiple, physically isolated data centers called Availability Zones. They have completely separate power supplies, cooling systems, and internet connections. If one building loses power, the other buildings keep running.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;A Load Balancer&lt;/strong&gt;: Think of a load balancer like a traffic officer. It sits in front of your servers, constantly checks which ones are healthy, and directs incoming traffic only to the servers that are working properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;How Does the Load Balancer Know a Server is Dead?&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
You might be wondering how exactly does the load balancer know when to stop sending traffic to Zone A and switch to Zone B?&lt;/p&gt;

&lt;p&gt;It relies on a mechanism called a &lt;strong&gt;Health Check&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of the load balancer as an overly attentive manager checking in on its employees. Every few seconds, the load balancer sends a tiny, automated request (like a digital "ping") to every web server it manages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Healthy State&lt;/strong&gt;: If the server is working properly, it instantly replies with a success code (specifically, an HTTP 200 OK status). The load balancer logs this as a healthy heartbeat and continues sending users to that server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Unhealthy State&lt;/strong&gt;: If a server crashes, freezes, or loses power, it won't reply. If the load balancer misses consecutive heartbeats (for example, 3 failed checks in a row), it officially marks that server as Unhealthy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once a server is marked unhealthy, the load balancer instantly removes it from the rotation. New users are seamlessly routed only to the healthy servers remaining in the other Availability Zones. Once the broken server is fixed and starts replying to heartbeats again, the load balancer automatically adds it back into the mix.&lt;/p&gt;

&lt;p&gt;Now that you know how load balancer works, lets build the Architecture diagram.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Architecture Diagram&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftw8jh3c5t31tnombcoq5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftw8jh3c5t31tnombcoq5.png" alt="This image is an AWS architecture diagram" width="712" height="790"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Architecture Diagram&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ez9i8d0jikidamgevtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ez9i8d0jikidamgevtf.png" alt="Azure Architecture Diagram" width="800" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now what happens when someone visits the application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Load Balancer receives the request and sends it to either Web Server 1 or Web Server 2.&lt;/li&gt;
&lt;li&gt;If Web Server 1 crashes, the load balancer detects the issue immediately and routes 100% of user traffic to Web Server 2. The user doesn't notice any disruption.&lt;/li&gt;
&lt;li&gt;For the Database, our primary database continuously syncs all saved data to a standby database in Zone B. If the primary database fails, the cloud provider automatically switches to the standby copy without losing any user records.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe8e5110relz0btrvzxau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe8e5110relz0btrvzxau.png" alt="This is a Sequence diagram showing how the load balancer works" width="799" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS vs. Azure: Service Comparison&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both major cloud providers give you managed tools to set this up with just a few clicks:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;What It Does?&lt;/th&gt;
&lt;th&gt;AWS Service&lt;/th&gt;
&lt;th&gt;Azure Service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Traffic Router&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Directs web traffic to healthy servers&lt;/td&gt;
&lt;td&gt;Application Load Balancer (ALB)&lt;/td&gt;
&lt;td&gt;Azure Application Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;App Servers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Runs the application code across multiple zones&lt;/td&gt;
&lt;td&gt;EC2 (in an Auto Scaling Group)&lt;/td&gt;
&lt;td&gt;Virtual Machine Scale Sets (VMSS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stores data with an automated backup copy&lt;/td&gt;
&lt;td&gt;Amazon RDS (Multi-AZ)&lt;/td&gt;
&lt;td&gt;Azure SQL (Zone-Redundant)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;For regional High Availability in Microsoft Azure, use Azure Application Gateway. If you want to expand globally later, you would put Azure Front Door in front of everything.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation: The One Line That Saves Your Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When setting up infrastructure with code (using tools like Terraform), turn on high availability for a database.&lt;/p&gt;

&lt;p&gt;Here is an AWS Terraform example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_db_instance"&lt;/span&gt; &lt;span class="s2"&gt;"my_application_db"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;allocated_storage&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
  &lt;span class="nx"&gt;engine&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_class&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"db.t3.medium"&lt;/span&gt;
  &lt;span class="nx"&gt;db_name&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app_database"&lt;/span&gt;
  &lt;span class="nx"&gt;username&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"dbadmin"&lt;/span&gt;
  &lt;span class="nx"&gt;password&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;db_password&lt;/span&gt;

  &lt;span class="c1"&gt;# This single line tells AWS to automatically maintain a backup database in a second zone:&lt;/span&gt;
  &lt;span class="nx"&gt;multi_az&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By setting &lt;strong&gt;multi_az = true&lt;/strong&gt;, AWS handles all the complex data replication, monitoring, and automatic failovers in the background.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaway&lt;/strong&gt;&lt;br&gt;
High Availability isn't about buying invincible hardware. It is about deploying duplicate resources across different physical locations so a failure in one area doesn't take your entire platform down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading &amp;amp; Official Documentation&lt;/strong&gt;&lt;br&gt;
If you want to dive deeper into the concepts covered in this article, check out the official documentation from AWS and Microsoft:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/reliability.html" rel="noopener noreferrer"&gt;AWS Well-Architected: Reliability Pillar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html" rel="noopener noreferrer"&gt;Amazon RDS Multi-AZ Deployments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/well-architected/" rel="noopener noreferrer"&gt;Azure Well-Architected: Reliability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/reliability/reliability-application-gateway-v2" rel="noopener noreferrer"&gt;Azure Application Gateway Zone Redundancy&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Coming Up in Part 2&lt;/strong&gt;: Now that our application won't crash from a single hardware failure, what happens when 50,000 users hit the site simultaneously on the final day of registration? We will cover Scalability and how to automatically add more power during traffic spikes.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>azure</category>
      <category>cloud</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Deploy Your Angular App with AWS S3 &amp; CloudFront: A Fast, Cost-Effective Guide</title>
      <dc:creator>Juhi Srivastava</dc:creator>
      <pubDate>Mon, 17 Aug 2026 20:42:47 +0000</pubDate>
      <link>https://dev.to/juhisri02/deploy-your-angular-app-with-aws-s3-cloudfront-a-fast-cost-effective-guide-35if</link>
      <guid>https://dev.to/juhisri02/deploy-your-angular-app-with-aws-s3-cloudfront-a-fast-cost-effective-guide-35if</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Deploying your Angular application to the cloud is a crucial step in sharing your work with the world. AWS offers a reliable and scalable way to host your app with minimal cost and effort — especially using S3 for static hosting combined with CloudFront for fast global delivery. In this guide, I’ll walk you through how to deploy your Angular app on AWS quickly, even if you’re new to AWS.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we start, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An Angular app ready to deploy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An AWS account (free tier is sufficient for basic hosting)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of Angular CLI and AWS Console&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Before we start …
&lt;/h2&gt;

&lt;p&gt;Before we dive into the step-by-step process to deploy an Angular app on AWS, it’s important to understand the core services we’ll be using: &lt;strong&gt;Amazon S3&lt;/strong&gt; and &lt;strong&gt;CloudFront&lt;/strong&gt;, and how they work together to host a static website efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Amazon S3?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon Simple Storage Service (Amazon S3)&lt;/strong&gt; is a highly scalable, secure, and durable object storage service. It allows you to store and protect any amount of data, supporting a wide range of use cases such as data lakes, mobile apps, backups, archives, enterprise applications, IoT devices, big data analytics, and — importantly for us — static website hosting.&lt;/p&gt;

&lt;p&gt;In simple terms, S3 acts as a reliable place to store your website files — HTML, CSS, JavaScript, images, and more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html" rel="noopener noreferrer"&gt;Learn more about Amazon S3&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  What is CloudFront?
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Amazon CloudFront&lt;/strong&gt; is a fast, secure, and programmable Content Delivery Network (CDN) service. It delivers your web content — including static and dynamic files, videos, APIs — globally with low latency and high transfer speeds.&lt;/p&gt;

&lt;p&gt;CloudFront caches your content at edge locations worldwide, so your users get faster access regardless of their geographical location. It acts as a distributed cache, retrieving content from your origin (like your S3 bucket) and serving it quickly from the nearest edge location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;Learn more about Amazon CloudFront&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Plan for Static Website Hosting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;S3&lt;/strong&gt; will store and deliver the static files of our Angular application (UI content).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We will deploy the Angular build output directly into an S3 bucket configured for static website hosting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To improve performance and reduce latency, &lt;strong&gt;CloudFront&lt;/strong&gt; will be used to distribute our content globally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Accessing the website directly from the S3 bucket is possible but can lead to higher latency, especially for users far from the AWS region hosting your bucket.&lt;/p&gt;

&lt;p&gt;CloudFront speeds up this delivery by caching content in multiple edge locations across the Americas, Europe, Asia, Africa, and more. When a user requests your website, CloudFront first checks its nearest cache (edge location). If the content is not found there, it fetches it from the S3 bucket and caches it for subsequent requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lets begin..
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Build Your Angular Application
&lt;/h3&gt;

&lt;p&gt;Open your terminal and navigate to your Angular project folder. Run the following command to build your app for production:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng build &lt;span class="nt"&gt;--prod&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command compiles your app into static files optimized for performance. The output will be in the &lt;code&gt;dist/your-app-name&lt;/code&gt; folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Create an S3 Bucket
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Log in to the AWS Management Console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to &lt;strong&gt;S3&lt;/strong&gt; and click &lt;strong&gt;Create bucket&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose a unique bucket name (e.g., &lt;code&gt;my-angular-app-bucket&lt;/code&gt;) and your preferred AWS region.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Leave the default settings, but &lt;strong&gt;uncheck “Block all public access”&lt;/strong&gt; so your site can be publicly accessible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Confirm the warning and create the bucket.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flgmh34er4eo52de7dgm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flgmh34er4eo52de7dgm1.png" alt=" " width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on your newly created bucket.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on “Properties” Tab and then edit the “&lt;strong&gt;Static website hosting&lt;/strong&gt;”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flgj9obgrwdbe2dds6vz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flgj9obgrwdbe2dds6vz6.png" alt=" " width="586" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Enable Static Website Hosting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on your bucket name, then go to the &lt;strong&gt;Properties&lt;/strong&gt; tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll down to &lt;strong&gt;Static website hosting&lt;/strong&gt; and click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Enable&lt;/strong&gt;, choose &lt;strong&gt;Use this bucket to host a website&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter &lt;code&gt;index.html&lt;/code&gt; as the &lt;strong&gt;Index document&lt;/strong&gt; and &lt;code&gt;404.html&lt;/code&gt; as the &lt;strong&gt;Error document&lt;/strong&gt; (create a 404 page or leave empty).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0lrxmxc7rfc9fcrabi98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0lrxmxc7rfc9fcrabi98.png" alt=" " width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftzutck7dcmenq62bf7ty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftzutck7dcmenq62bf7ty.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Upload Your Angular Build Files
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;dist/your-app-name&lt;/code&gt; folder on your computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the AWS Console, go to your S3 bucket and click &lt;strong&gt;Upload&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upload all the files and folders from the &lt;code&gt;dist&lt;/code&gt; directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alternatively, use below commands:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3 &lt;span class="nb"&gt;cp&lt;/span&gt; ./dist s3://YOUR-BUCKET-NAME –recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F0cycy81pv7y1au3zhr7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0cycy81pv7y1au3zhr7h.png" alt=" " width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to “Permissions” and navigate to the Public Access settings for your bucket. Unselect “&lt;em&gt;Block public and cross-account access if bucket has public policies&lt;/em&gt;” . We have to change it to false, otherwise it will block public access and our app will be inaccessible from internet. By default all AWS S3 buckets are private.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fsrcd5t0nzktjdfsrw7lq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsrcd5t0nzktjdfsrw7lq.png" alt=" " width="586" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Set Bucket Policy for Public Access
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In the “Permissions” Tab , add the bucket policy to “&lt;em&gt;GetObject&lt;/em&gt;” that will allow public to access our data. Apply the policy that will allow public access to data in AWS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save the policy.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fp2m2jg4rxv6xdh8p73bn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp2m2jg4rxv6xdh8p73bn.png" alt=" " width="800" height="345"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PublicReadGetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::YOUR_BUCKET_NAME/*"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Use CloudFront for CDN and HTTPS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Navigate to AWS CloudFront Console&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Visit &lt;a href="https://console.aws.amazon.com/cloudfront/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/cloudfront/&lt;/a&gt; and click &lt;strong&gt;Create Distribution&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Choose Delivery Method&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Select &lt;strong&gt;Web&lt;/strong&gt; as the delivery method and click &lt;strong&gt;Get Started&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Origin Settings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For &lt;strong&gt;Origin Domain Name&lt;/strong&gt;, select or enter your S3 bucket URL.&lt;/li&gt;
&lt;li&gt;Make sure to choose the correct bucket that hosts your static website content.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set Viewer Protocol Policy&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Under &lt;strong&gt;Default Cache Behavior Settings&lt;/strong&gt;, change the &lt;strong&gt;Viewer Protocol Policy&lt;/strong&gt; to &lt;strong&gt;Redirect HTTP to HTTPS&lt;/strong&gt; to enforce secure connections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Distribution Settings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Distribution Settings&lt;/strong&gt; section, add your &lt;strong&gt;Alternative Domain Name (CNAME)&lt;/strong&gt; if you want to use a custom domain (e.g., &lt;a href="http://www.yourdomain.com" rel="noopener noreferrer"&gt;www.yourdomain.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Select an appropriate &lt;strong&gt;SSL Certificate&lt;/strong&gt; (either an AWS Certificate Manager certificate for your domain or use the default CloudFront certificate) to enable HTTPS.&lt;/li&gt;
&lt;li&gt;If you don't need a custom domain, leave the SSL settings as default.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Review and Create&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Keep other settings at their default values unless you have specific requirements.&lt;br&gt;&lt;br&gt;
Scroll down and click &lt;strong&gt;Create Distribution&lt;/strong&gt; to finalize.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wait for Distribution Deployment&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
CloudFront will take approximately &lt;strong&gt;10–15 minutes&lt;/strong&gt; to deploy your distribution. You’ll be notified when it’s ready.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftnzwa2zcoz1pmsc6xow6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftnzwa2zcoz1pmsc6xow6.png" alt=" " width="799" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Navigate to Distributions to see the newly created distribution. The domain name column contains your CloudFront URL, which will be something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://YOUR-BUCKET-NAME.s3-website-YOUR-BUCKET-ZONE.amazonaws.com" rel="noopener noreferrer"&gt;&lt;em&gt;YOUR-BUCKET-NAME.s3-website-YOUR-BUCKET-ZONE.amazonaws.com&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fj0wgzcftilecvuw53ql1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fj0wgzcftilecvuw53ql1.png" alt=" " width="586" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the CloudFront URL and paste it into the browser tab. You should successfully see your application.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Things to Keep in Mind When Configuring an S3 Bucket as a Static Website
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Eable Static Website Hosting:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To serve your content as a static website, you need to enable static website hosting on your S3 bucket. This setting allows Amazon S3 to function like a web server.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Configure and Upload an Index Document:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;index document&lt;/strong&gt; is the default webpage that Amazon S3 returns when visitors access the root of your website or any subfolder. Make sure to create and upload this file (usually &lt;code&gt;index.html&lt;/code&gt;) to your bucket.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Set Permissions for Public Access (if required):&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you want your website to be publicly accessible, you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1. &lt;strong&gt;Disable the “Block Public Access” settings&lt;/strong&gt; on your bucket.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2. &lt;strong&gt;Add a bucket policy&lt;/strong&gt; that grants public read permissions, allowing anyone to view your website content.&lt;br&gt;&lt;br&gt;
    Without these permissions, users won’t be able to access your website.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;strong&gt;Understand Your Website Endpoint URL&lt;/strong&gt;&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;When static website hosting is enabled, your website is accessible via an AWS Region-specific endpoint.&lt;br&gt;&lt;br&gt;
The URL format depends on your region and typically looks like one of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://bucket-name.s3-website-&lt;region&gt;.amazonaws.com" rel="noopener noreferrer"&gt;&lt;em&gt;http://bucket-name.s3-website-&amp;lt;region&amp;gt;.amazonaws.com&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(with a dash -)&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://bucket-name.s3-website.&lt;region&gt;.amazonaws.com" rel="noopener noreferrer"&gt;&lt;em&gt;http://bucket-name.s3-website.&amp;lt;region&amp;gt;.amazonaws.com&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(with a dot .)&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Refer to AWS Documentation for More Details:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For comprehensive guidance on static website hosting with Amazon S3, visit the official AWS docs:  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html?source=post_page-----4578752270c3---------------------------------------" rel="noopener noreferrer"&gt;Hosting a static website using Amazon S3&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>website</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
