Hi, everyone, and welcome back.
Now, in today's video will be looking into the differences and the use cases where you should use cloud,
print, function and lambda edge.
Now, as we have seen, both of them are quite similar and in exams they might test you with a use case
where you'll have to select one among them.
So let's go ahead and understand this in a better terms.
Now, this table, which I have attached directly from the documentation, is very helpful.
And in case if you see some questions in exams, most of them would be based on the things that are
described here.
One of the primary difference here is the programming language where Cloudflare supports JavaScript,
Lambda supports Node.js and Python.
Even source is again one of the major differences where cloud print function supports only viewer request
for your response.
Lambda Edge.
Along with this, it also supports origin request and origin response.
Now, when it comes to scalability, cloud functions are much, much more scalable when compared with
lambda.
One of the important things here is related to the access to the request body.
Now cloud front function cannot access the request body.
Very important part to remember lambda can.
And apart from that, when it comes to more complex use cases like network access, file system access
and others, Lambda Edge has much more better capability there.
So at a high level overview note that cloud run functions are ideal for lightweight short running functions,
and there are certain use cases where cloud functions can prove to be useful.
For example, if you want to transform a HTTP request attributes including headers, query strings,
etc. if you want to perform header manipulation like insert or modify or delete HTTP headers in both
the request or response.
Apart from that, the cloud print function also helps in the URL redirect or rewriting.
This is something that we have already seen as part of the demo, and the next is related to the request
authorization where it can inspect the overall authorization header as well.
So let's understand this with a sample question.
The question states that based on the new application update, there is a new header HTTP header that
is sent into response.
So this new header is creating issues with the client and it is also leading to multiple errors from
client side.
So the question states that there is a requirement to remove these headers without modifying the application.
So the application is sending a HTTP header in the response.
You do not want to modify the application, but you still want to remove the header.
So in such cases, what are the ways that you can use to achieve this?
You can use cloud trend functions, you can use Lambda Edge.
Now ideally both of them will be able to achieve this.
However, we will be selecting cloud front functions because they are much more lightweight and also
much more scalable.
So this is one thing that you need to keep in mind.
So that's the very high level overview and with this will conclude today's video.