00:00 - 00:03

have you ever wondered what really

00:01 - 00:05

happens behind the scenes when you click

00:03 - 00:07

a button on a website today we are

00:05 - 00:09

following a single request through the

00:07 - 00:11

entire architecture of a modern web

00:09 - 00:13

application so you can understand

00:11 - 00:16

exactly what happens from DNS resolution

00:13 - 00:17

to backend databases by the end of this

00:16 - 00:19

video you will have a deeper

00:17 - 00:23

appreciation for all the moving parts

00:19 - 00:23

that make your favorite apps run

00:25 - 00:30

smoothly when a user types example.com

00:27 - 00:33

into their browser the DNS acts as the

00:30 - 00:35

internet's phone book translating the

00:33 - 00:37

domain into an IP address this IP

00:35 - 00:39

address could point to a load balancer

00:37 - 00:41

or a AWS cloudfront distribution

00:39 - 00:44

depending on the architecture quick DNS

00:41 - 00:46

resolution is crucial because it helps

00:44 - 00:49

reduce initial load times ensuring users

00:46 - 00:51

can access your site quickly so if

00:49 - 00:53

you're using AWS Route 53 it helps you

00:51 - 00:56

direct the user to the closest available

00:53 - 00:59

server ensuring fast and efficient

00:56 - 01:02

routing next up is the content delivery

00:59 - 01:05

Network or CDN services like AWS Cloud

01:02 - 01:08

front cash static assets images videos

01:05 - 01:10

and CSS files at Edge locations closer

01:08 - 01:12

to your users this helps reduce latency

01:10 - 01:14

and speeds up load times especially for

01:12 - 01:16

users spread out across different

01:14 - 01:18

regions and in today's world where even

01:16 - 01:20

a 1second delay can lead to drop offs

01:18 - 01:22

speed is everything not only does

01:20 - 01:25

cloudfront improve speed but it also

01:22 - 01:27

helps reduce cost by offloading request

01:25 - 01:29

from your main server especially when

01:27 - 01:31

handling Global traffic before the

01:29 - 01:33

request reaches your backend Services it

01:31 - 01:36

passes through web application firewall

01:33 - 01:38

or vaav a vaav is your application's

01:36 - 01:40

first line of defense imagine someone

01:38 - 01:42

trying to hack into your system using

01:40 - 01:44

SQL injection or cross- siiz scripting

01:42 - 01:46

attacks VAV stops those attacks in their

01:44 - 01:48

tracks by filtering out malicious

01:46 - 01:50

traffic before it even hits your backend

01:48 - 01:52

Services after passing through VAV the

01:50 - 01:54

request reaches enginex which serves as

01:52 - 01:56

a reverse proxy it routes traffic

01:54 - 01:59

handles SSL termination and caches

01:56 - 02:02

Dynamic content now while engin X offers

01:59 - 02:04

fine grain control but services like

02:02 - 02:06

cloudfront or ALB can handle many of

02:04 - 02:08

these tasks making engine X an optional

02:06 - 02:10

component in certain architectures

02:08 - 02:13

however when you need more control over

02:10 - 02:16

routing caching or SSL termination

02:13 - 02:18

engine X becomes a valuable addition now

02:16 - 02:20

the load balancer ensures availability

02:18 - 02:23

by Distributing incoming traffic across

02:20 - 02:25

multiple backend servers with NLB or

02:23 - 02:27

network load balancer you get low

02:25 - 02:28

latency High throughput handling for

02:27 - 02:30

applications that need Extreme

02:28 - 02:33

Performance like gaming or Financial

02:30 - 02:34

Services on the other hand an ALB or

02:33 - 02:37

application load balancer gives you

02:34 - 02:39

Advanced routing capabilities ideal for

02:37 - 02:41

web apps and microservices where

02:39 - 02:43

requests need to be routed based on

02:41 - 02:45

specific paths or host names both

02:43 - 02:46

Network load balancer and application

02:45 - 02:49

load balancer operate at different

02:46 - 02:51

layers of OSI models previously I have

02:49 - 02:53

made a video on the OSI and TCP layer

02:51 - 02:55

breaking down and explaining each of

02:53 - 02:57

these layers with practical examples NLB

02:55 - 02:59

operates at the transport layer which is

02:57 - 03:01

the layer four of the OSI model this

02:59 - 03:04

means it forwards traffic based on the

03:01 - 03:05

IP address and port number without

03:04 - 03:08

inspecting the content of the request

03:05 - 03:11

for example HTTP headers or paths it is

03:08 - 03:14

designed to handle protocols like TCP or

03:11 - 03:16

transmission control protocol and UDP

03:14 - 03:17

which stands for user datagram protocol

03:16 - 03:19

which makes it suitable for high

03:17 - 03:21

performance low latency applications

03:19 - 03:23

handling very large amounts of traffic

03:21 - 03:26

with millions of requests per second

03:23 - 03:27

while maintaining very low latency this

03:26 - 03:29

makes it ideal for real-time

03:27 - 03:31

applications such as gaming or services

03:29 - 03:33

your speed and throughput are critical

03:31 - 03:35

ALB operates at the application layer

03:33 - 03:37

which is the layer seven of the OSI

03:35 - 03:40

model which means it can inspect the

03:37 - 03:43

content of HTTP or https request making

03:40 - 03:45

it suitable for web application rest

03:43 - 03:47

apis or microservices architecture it

03:45 - 03:49

can Route traffic based on attributes

03:47 - 03:52

like request paths for example routing

03:49 - 03:54

based on specific API paths like API

03:52 - 03:56

users or API products or it can also

03:54 - 03:59

drout traffic based on attributes such

03:56 - 04:02

as host name for example a request to

03:59 - 04:05

example ./ API can be routed to a

04:02 - 04:06

backend API service or a request to

04:05 - 04:08

example.com

04:06 - 04:11

static can be routed to a different

04:08 - 04:13

service that handles static content the

04:11 - 04:15

API Gateway acts like a traffic cop

04:13 - 04:18

validating request ensuring the user is

04:15 - 04:20

authorized and enforcing rate limits

04:18 - 04:22

rate limiting and throttling prevent any

04:20 - 04:24

single client from overwhelming your

04:22 - 04:26

system keeping everything running

04:24 - 04:29

smoothly after this the request is

04:26 - 04:31

routed to the right backend service

04:29 - 04:33

whether that's an easy to instance a AWS

04:31 - 04:35

Lambda function or a microservice

04:33 - 04:38

running in kubernetes once the API gate

04:35 - 04:41

fit does its job it's up to the backend

04:38 - 04:43

services to handle the heavy lifting now

04:41 - 04:45

in microservices architecture each

04:43 - 04:47

service is dedicated to a specific

04:45 - 04:50

function allowing teams to work

04:47 - 04:51

independently scale Services more easily

04:50 - 04:54

and make updates without impacting the

04:51 - 04:56

entire system for instance one service

04:54 - 04:58

might handle user authentication while

04:56 - 05:01

another process payments with each

04:58 - 05:03

service able to scale or up separately

05:01 - 05:06

all while interacting with databases

05:03 - 05:08

like post SQL or Dynamo TV speaking of

05:06 - 05:10

databases they are the heart of your

05:08 - 05:12

application where your persistent data

05:10 - 05:14

is stored for distributed applications

05:12 - 05:16

that need to scale dynamically a nosql

05:14 - 05:18

database like Dynamo DV works best due

05:16 - 05:21

to its flexibility and ability to handle

05:18 - 05:23

unstructured data meanwhile for

05:21 - 05:25

application with structured relational

05:23 - 05:27

data and SQL database like post SQL is

05:25 - 05:30

often the best choice for asynchronous

05:27 - 05:32

task request might be passed to HQ like

05:30 - 05:34

Kafka or sqs which handles STS that

05:32 - 05:37

don't need immediate processing such as

05:34 - 05:38

email notification or background jobs in

05:37 - 05:40

addition to handling request your

05:38 - 05:43

application likely uses additional

05:40 - 05:47

layers like authentication using or 2.0

05:43 - 05:50

or open ID connect or JWT basically to

05:47 - 05:52

verify users caching can be used to

05:50 - 05:54

speed up responses and logging for

05:52 - 05:57

tracking system Health Services like

05:54 - 05:58

redis or mcast can catch frequently

05:57 - 06:00

requested data reducing the load on

05:58 - 06:02

backend services

06:00 - 06:04

monitoring tools like promas or AWS

06:02 - 06:06

Cloud watch ensure your system is

06:04 - 06:08

running smoothly by tracking metrics and

06:06 - 06:09

identifying issues before the escalate

06:08 - 06:11

now that your backend services and

06:09 - 06:14

additional components have done their

06:11 - 06:16

job it's time for the response to make

06:14 - 06:18

its way back to the user this journey is

06:16 - 06:20

just as important as the request itself

06:18 - 06:22

and it follows a similar path back

06:20 - 06:24

through the system so the process

06:22 - 06:26

response is sent back to the API Gateway

06:24 - 06:28

which may apply additional formatting or

06:26 - 06:30

Transformations before routing it to the

06:28 - 06:32

client the load balancer efficiently

06:30 - 06:35

routes the response back to the user's

06:32 - 06:37

original request balancing any outgoing

06:35 - 06:39

traffic if necessary and if any static

06:37 - 06:41

content was part of the response such as

06:39 - 06:43

images or cach data it can be served

06:41 - 06:46

directly from a CDN Edge location to

06:43 - 06:48

minimize latency ensuring a quicker

06:46 - 06:50

response finally the response reaches

06:48 - 06:52

the users browser or mobile app

06:50 - 06:54

displaying the requested data completing

06:52 - 06:56

the full request response cycle in a

06:54 - 06:58

well-designed system this entire Journey

06:56 - 07:00

from the user's request to the final

06:58 - 07:03

response happens milliseconds ensuring

07:00 - 07:04

fast reliable performance from DNS

07:03 - 07:06

resolution to the database and

07:04 - 07:08

everything in between every layer plays

07:06 - 07:10

a crucial role in delivering a smooth

07:08 - 07:12

fast experience to users understanding

07:10 - 07:13

both the request and response life cycle

07:12 - 07:16

gives you a solid foundation for

07:13 - 07:17

Designing resilient scalable systems let

07:16 - 07:19

me know in the comments if you'd like me

07:17 - 07:21

to dive deeper into any of these topics

07:19 - 07:23

and don't forget to like subscribe and

07:21 - 07:25

hit the notification Bell for more deep

07:23 - 07:28

dives into Cloud architecture and system

07:25 - 07:28

design

07:28 - 07:31

[Music]

Demystifying Web Application Architecture: Understanding the Journey from User Click to Response

Have you ever wondered what happens behind the scenes when you click a button on a website? In this insightful exploration, we will trace a single request through the intricate architecture of a modern web application, shedding light on the journey from DNS resolution to backend databases. By the end of this narrative, you will appreciate the complexity and coordination of the various components that enable your favorite apps to run seamlessly.

DNS Resolution and Load Balancing

When a user enters a domain like example.com, the Domain Name System (DNS) translates it into an IP address. This IP address leads to a load balancer or an AWS CloudFront distribution based on the architecture in place. Fast DNS resolution is vital for reducing load times and ensuring quick access to the site.

Content Delivery Networks (CDN) and Firewall Protection

A Content Delivery Network (CDN) like AWS CloudFront caches static assets closer to users, reducing latency and speeding up load times. Before reaching backend services, requests pass through a Web Application Firewall (WAF) that acts as the application's defense line against malicious attacks like SQL injections or cross-site scripting.

Load Balancers and Request Routing

Load balancers distribute incoming traffic across backend servers for high availability. Network Load Balancers (NLB) offer low latency and high throughput, ideal for performance-demanding applications like gaming. Application Load Balancers (ALB) provide advanced routing capabilities, suitable for web apps and microservices that require specific path-based routing.

Backend Services and Database Handling

Backend services, including AWS Lambda functions or microservices, handle the heavy lifting once requests pass through the API Gateway. In a microservices architecture, each service focuses on a specific function, allowing independent scaling and updates without system-wide impacts. Databases like DynamoDB or PostgreSQL store persistent data, with NoSQL databases being flexible for dynamically scaling applications.

Additional Components and Response Journey

Components like authentication protocols, caching mechanisms, and monitoring tools enhance system performance. As the response travels back to the user, it undergoes additional formatting, routing through the API Gateway and load balancer before reaching the user's browser or mobile app for a seamless user experience.

Understanding the intricate process from user click to response completion is key to designing resilient and scalable systems. Each layer, from DNS resolution to database interaction, plays a vital role in delivering a fast and reliable performance to users. Delve deeper into any of these topics by engaging in the comments and stay tuned for more insights into Cloud architecture and system design.


In the dynamic realm of web application architecture, every component, from DNS resolution to load balancing and database handling, harmoniously collaborates to offer users a smooth and efficient digital experience. Each layer contributes to the seamless flow of data, ensuring that a user's interaction with a website is fast and reliable.