00:00:00
have you ever wondered how some of the
00:00:02
largest websites handle millions of
00:00:04
users simultaneously without crashing or
00:00:07
how they transfer your data securely
00:00:10
when directing you to the right server
00:00:12
in this video we're going to dive into
00:00:14
the three critical web components which
00:00:17
are proxies reverse proxies and load
00:00:19
balancers whether you are an engineer or
00:00:22
just curious about how the internet
00:00:24
works behind the scenes in this video we
00:00:26
will break down these complex Concepts
00:00:28
in simple easy to understand terms so
00:00:31
let's get started imagine you were
00:00:33
planning a dinner at a popular
00:00:35
restaurant but you don't want to
00:00:37
interact directly with the staff because
00:00:39
you're too busy or too lazy or you're
00:00:42
shy whatever the reason so instead you
00:00:44
have a personal assistant who makes the
00:00:46
reservation on your behalf so the
00:00:49
restaurant staff never interacts
00:00:51
directly with you they only communicate
00:00:54
with your assistant in this scenario you
00:00:56
are the laptop that you use to browse
00:00:59
the internet and your personal assistant
00:01:01
is a proxy server and proxy server acts
00:01:04
as a middleman between your private
00:01:07
Network which your laptop is connected
00:01:09
to and the public internet where your
00:01:12
requests go out and the proxy is
00:01:15
protecting your laptop by filtering
00:01:18
traffic and blocking any harmful
00:01:21
websites or scripts or code before the
00:01:25
response gets forwarded back to you now
00:01:28
in a company scenario where this is more
00:01:31
important let's say you have many
00:01:33
employees and they are browsing the
00:01:35
internet and going on who knows what
00:01:37
websites so for example if your
00:01:39
marketing employee visits some shady
00:01:41
website and clicks on a link to download
00:01:44
some new presentation tool in maybe a
00:01:47
malicious website so they send some
00:01:48
virus as a response along with the tool
00:01:51
and when a malicious content or script
00:01:54
penetrates your company internal Network
00:01:57
through one employees computer it may do
00:02:00
some real damage to many other things in
00:02:03
your company so to protect the internal
00:02:05
Network an administrator in the company
00:02:08
May configure all internet traffic of
00:02:11
all employees machines to be routed
00:02:14
through a proxy so proxy will now stand
00:02:17
as the guard of your company internal
00:02:19
Network you can Blacklist any websites
00:02:22
that you don't want any of your people
00:02:23
to visit and proxy will block this
00:02:26
traffic but for any other requests that
00:02:28
actually do go out to the to various
00:02:31
websites it will also scan the responses
00:02:34
for any viruses and of course block them
00:02:36
if they are malicious so it acts as a
00:02:39
shield between your private Network and
00:02:41
the public internet plus it can also log
00:02:44
user activity to show what sites people
00:02:48
are visiting and on top of that proxy
00:02:51
also has another important feature which
00:02:53
is caching responses so for example if
00:02:56
one engineer in your company visits this
00:02:59
tutorial video about proxies to learn
00:03:02
new skills the proxy will fetch that
00:03:05
video from YouTube and cach it locally
00:03:08
so now when 10 other Engineers see that
00:03:11
and decide they also want to watch such
00:03:13
informative tutorial to learn new skills
00:03:17
proxy will just return the cached copy
00:03:19
instead of fetching it again from
00:03:21
YouTube and this way it will save
00:03:23
bandwidth and reduce any unnecessary
00:03:26
traffic to the internet and this kind of
00:03:29
proxy is also called a forward proxy now
00:03:33
back to our restaurant analogy your
00:03:36
assistant made the reservation and you
00:03:38
arrive now what you do is instead of
00:03:41
wandering around looking for a table
00:03:43
yourself you check in at the reception
00:03:46
desk right the receptionist tells you
00:03:48
follow me and shows you to the right
00:03:50
table so here the receptionist is also a
00:03:54
proxy but this time on a receiving end
00:03:57
of the request it sits in front of the
00:04:00
restaurant's internal dining areas which
00:04:03
in our case are the servers and manages
00:04:06
the incoming requests or the guests and
00:04:09
distributes them to the right Tables by
00:04:11
checking the capacity and having
00:04:13
overview of the entire flow and this
00:04:16
proxy sitting on the server side
00:04:18
handling those incoming requests from
00:04:21
clients is called a reverse proxy and
00:04:24
the function of Distributing the guests
00:04:27
evenly across dining areas and tables is
00:04:30
load balancing which is one of the key
00:04:33
functionalities of a reverse proxy but
00:04:36
it's not the only functionality reverse
00:04:38
proxies actually have most of the
00:04:40
features that the forward proxies have
00:04:43
like acting as a shield to protect the
00:04:45
servers because when you have hundreds
00:04:47
of servers and they all have access to
00:04:50
sensitive data or code it's really
00:04:52
dangerous to expose all hundred servers
00:04:55
directly to the internet instead you
00:04:57
protect them in an internal Network and
00:04:58
you just put one or few proxy servers as
00:05:02
an entry point and you configure all the
00:05:04
security measures on that handful of
00:05:06
proxies so what the reverse proxies will
00:05:09
do is they will scan the request they
00:05:11
will ensure SSL encryption is enabled so
00:05:14
the traffic is encrypted and will check
00:05:17
basically for any security threats or
00:05:19
any attempts of hecking into your
00:05:22
systems it also provides caching to
00:05:25
speed up responses to the clients and
00:05:28
has a logging functional for doing
00:05:30
troubleshooting for example so a lot of
00:05:32
the features forward proxy has reverse
00:05:34
proxy has as well and one of the most
00:05:37
popular reverse proxies is engine X
00:05:40
which you may already know as an
00:05:42
engineer if not I actually have a
00:05:44
separate video on enginex that you can
00:05:46
watch here so as you see load balancing
00:05:49
is just one of the many functionalities
00:05:52
of a reverse proxy so it's a feature
00:05:55
that proxy can perform now many of you
00:05:58
may ask here but what about the cloud
00:06:01
load balancers why do we need reverse
00:06:04
proxy if we have cloudload balancers are
00:06:07
they a replacement for reverse proxies
00:06:10
like ads and other Cloud platforms they
00:06:13
all have load balancers so why do I need
00:06:15
an engine X reverse proxy to load
00:06:18
balance the incoming traffic if I can
00:06:21
just use AWS load balancer well in
00:06:23
practice you actually want to use both
00:06:26
and here is why for example you would
00:06:28
have your Cloud load balancer outside of
00:06:31
your servers as an entry point into your
00:06:34
private Network while reverse proxy will
00:06:38
be routing traffic within your server
00:06:40
Network so now you are encapsulating the
00:06:43
reverse proxy and those backend servers
00:06:46
all into a private Network and the load
00:06:48
balancer basically just sits there and
00:06:50
does a basic load balancing to the
00:06:53
reverse proxy and this type of layered
00:06:56
approach actually makes your
00:06:58
infrastructure much more secure and also
00:07:01
much more scalable you may be asking why
00:07:03
do I need to load balance twice on
00:07:05
multiple levels so why do I need proxy
00:07:08
inside if I have the load balancing
00:07:10
outside reverse proxy actually has more
00:07:13
intelligent fine grained load balancing
00:07:16
which will allow you to do much more
00:07:19
intelligent routing to the web servers
00:07:22
so while Cloud load balcers distribute
00:07:24
traffic based on simple algorithms like
00:07:27
whoever is the least busy on on reverse
00:07:30
proxy you can configure more advanced
00:07:31
routing logic based on headers cookies
00:07:35
or session data for example you can
00:07:36
decide all the requests from the same
00:07:39
user they always go to the same web
00:07:41
server so it will basically check the
00:07:43
associated session data or cookies and
00:07:46
it will forward the same client requests
00:07:49
to the same server reverse proxy can
00:07:51
also handle SSL and TLS termination and
00:07:55
you can inspect the encrypted traffic to
00:07:58
make more informed load balancing
00:08:00
decisions and this is especially
00:08:02
important in microservices architecture
00:08:04
where you may have plenty of
00:08:06
microservices and based on the request
00:08:09
path for example or the URL you may want
00:08:12
to forward that request to a specific
00:08:15
micro service so it's a very logical
00:08:18
load balancing that reverse proxy is
00:08:20
doing here and in our restaurant
00:08:23
scenario this would be equivalent to if
00:08:25
our receptionist for example knew some
00:08:28
loyal guests and showed them to their
00:08:30
favorite table to have dinner or they
00:08:33
selected a table with the best view for
00:08:36
guests who are celebrating a special
00:08:38
occasion or giving a different menu for
00:08:41
vegetarian guests and so on so basically
00:08:43
more customized request handlink based
00:08:46
on a little bit more information about
00:08:48
the guests and the setup that I
00:08:51
described is actually exactly the one
00:08:53
that we would use in a kubernetes
00:08:55
cluster with microservices where an
00:08:57
Ingress controller which is a basically
00:08:59
reverse proxy for kubernetes will handle
00:09:02
internal routing and security while the
00:09:06
cloudload balancer will act as the first
00:09:08
line of defense managing the external
00:09:11
traffic and kind of shielding them
00:09:13
before they get to the cluster and
00:09:15
finally another question you may be
00:09:18
asking here especially if you are a
00:09:20
software engineer is what about the
00:09:23
servers or proxies that start
00:09:26
automatically when I run my node.js or
00:09:28
Java application
00:09:29
what are those are those reverse proxies
00:09:32
as well how do they run or how do they
00:09:34
start in the background well these are
00:09:37
lightweight proxies for example node.js
00:09:40
it doesn't have a built-in reverse proxy
00:09:43
but you can easily create one using its
00:09:46
HTTP module or a framework like
00:09:49
expressjs which is actually a framework
00:09:51
that most people use with noj so
00:09:55
compared to engine X for example which
00:09:57
is used in production prj serves
00:10:00
different purpose however these two can
00:10:03
actually be used in combination so for
00:10:05
comparison engine X is a high
00:10:08
performance web server and reverse proxy
00:10:11
so it's a technology that can be used
00:10:13
for web server as well as reverse proxy
00:10:16
and it's ideal for serving static
00:10:18
content has load balancing functionality
00:10:21
it handles security features like SSL
00:10:24
termination and so on while expressjs is
00:10:27
a minimalist web framework for noj
00:10:30
specifically used to build Dynamic web
00:10:33
applications and apis and you can
00:10:35
actually configure some custom logic and
00:10:37
middleware for how the request should be
00:10:40
handled for different endpoints plus
00:10:43
engine X also has an advantage that it
00:10:45
can handle a large number of concurrent
00:10:48
connections very efficiently while
00:10:50
expressjs is less performant in that
00:10:53
area so in proper production setup
00:10:55
engine X is often deployed in front of
00:10:58
an exper
00:10:59
application is a reverse proxy so in
00:11:02
this setup engine X will handle static
00:11:05
files load balance requests and manage
00:11:07
the security while expressjs will
00:11:10
process the more Dynamic content so
00:11:13
that's basically the breakdown of proxy
00:11:16
versus reverse proxy as well as load
00:11:18
balancer which is pretty simple if you
00:11:21
understand them at this basic level so I
00:11:22
hope I was able to help you understand
00:11:25
what these concepts are clearly and more
00:11:27
importantly how they compare to each
00:11:30
other which I think is probably the most
00:11:32
challenging part of understanding
00:11:34
proxies and load balancing and so on now
00:11:37
if you enjoyed this video and you really
00:11:39
want to advance your it career then we
00:11:43
can absolutely help you with our
00:11:45
structured learning programs which are
00:11:47
focused on practical demos that mirror
00:11:50
real life projects and one of the most
00:11:53
important ones that we have is our
00:11:55
certified devops practitioner program we
00:11:57
have trained thousands of Engineers who
00:12:01
have successfully transitioned from
00:12:03
other engineering roles like network
00:12:05
engineer test engineer software engineer
00:12:07
to getting their first devops
00:12:09
engineering jobs transitioning
00:12:12
successfully into devops and even
00:12:15
sometimes moving countries to work at
00:12:17
their dream company however there is a
00:12:20
prerequisite knowledge required to do
00:12:22
this program this means if you have a
00:12:25
solid IT background in any other
00:12:28
engineering field and you know already
00:12:30
that devops engineering is currently one
00:12:33
of the most promising and one of the
00:12:36
most futureproof IT jobs that you can
00:12:38
have our DeVos boot camp will literally
00:12:41
guide you step by step through every
00:12:44
single cloud and devops technology that
00:12:47
you need to learn and how to combine
00:12:49
them and use them together to build
00:12:51
endtoend devops processes if you're
00:12:54
interested you can actually download a
00:12:56
free pdf that lists all the real life
00:13:00
demo projects that you're going to be
00:13:03
building and learning with throughout
00:13:05
the dev of boot camp and you will find
00:13:07
the link to this PDF in the description
00:13:09
along with all the other relevant
00:13:12
information for this video and as always
00:13:15
thank you for watching and see you in
00:13:17
the next video