Hi, everyone, and welcome back.
Now, in today's video, we are going to discuss about Lambda Versioning.
Now, one of the great benefits of Lambda is that it allows the developers to host multiple versions
of their code.
So if you look into this diagram, this Lambda has two versions.
You have version one app, version two app, and subsequently you can have newer versions of the code
that has been deployed.
Now, in fact, before we proceed further, let's quickly look into it.
So I have a demo lambda function that is available now in here.
You see you have a hello from base code.
Now this specific lambda function has multiple versions, so if you look into the version, you have
version one and you have version two.
So if you look into the version one, let's look into the code.
You have Halo from production, as you can see in a similar way.
Let's go back if you go to the version two.
If you go to the code this time you have hello from Dev code.
So the primary learning year is that different version can have different set of code and this allows
you to also quickly test things out.
So at the overview when we discuss about the function version.
So this includes the following information.
First one is that it includes the function code and all the associated dependencies.
It also includes the overall runtime identifier and runtime version that is been used by the function.
All the function settings, including the environment variables.
This can also differ and the unique end to identify the specific version of function.
For example, if you look into the version two of the function, it has this specific line and in the
end you have to.
Similarly, if you go back to the function version one, if you look into the end, you have one.
So each version has a different function and this also allows easy testing.
Now one of the major advantages of function is that you can allow certain amount of traffic to go towards
the newer function code to test if everything is working fine.
For example, here the Lambda is sending 95% of traffic to the broad version and maybe 5% of traffic
to the stage version.
So this stage version might have the newer code.
And if all of the 5% of traffic is able to successfully able to achieve the task, then at a later stage
you can go ahead and promote this stage version to the newer version.
So this is immensely helpful.
So that's a very high level overview about the functions in Lambda, and with this will conclude today's
video.