In this video we are going to learn what is Neve in the Willis SDK for JavaScript version three and
why we are using the version three and understand the lambda function called START benefits when using
the version three.
Basically the SDK for JavaScript version three is rewrite of the version two with some great new features.
As with the Virgin tool, it enables you to easily work on the services but has a modular architecture
with a separate package for each services.
It also includes many frequently requested features, such as a first class typescript support and a
new middleweight stake.
So we can say that Virgin three of the SDK for JavaScript contains these new features which are the
modularized packages.
Users can now use a separate package for each service, and there's a new middleware stack.
Users can now use a middleware stack to control the lifecycle of operational call.
In addition, the SDK is written in triplicate, which has many advantages, such as the static typing.
So let's elaborate these items and let's focus on the modularized package.
Version two of the SDK for JavaScript.
Version two require you to use the entire Adobe SDK and see the code block in here where A is required.
The entire package, which is the SDK and loading the entire SDK isn't an issue if your application
is using many services.
However, if you need to use only a few Adobe services, it means increasing the size of your application
with the code you don't need to use.
So but in version three, we can load and use only individual services that we need.
See the example Dynamo DB in here.
We can use the import statement for Dynamo DB client from the Dynamo DB Client Libraries and this gives
you access to Amazon Dynamo DB Client object to interact with the Amazon Dynamo DB on there.
So that means not only can you load and use individual services, but you can also load and use only
the service commands that we need.
So you can see the example called in.
Here is the import statement.
This gives us the access to Dynamo DB client and the list table commands in here.
So basically we need only the listing tables from Dynamo DB so we can specifically download the only
required Dynamo DB libraries and a special release table command.
So this package management with version three, we install only required package and this comes with
a great benefit which is the size of the code decrease dramatically.
Let's give an example.
If you compare to listing tables from Dynamic DB, which using version two and version three, we can
say that in version two, it's using the whole package and the SDK package adds about 40 megabytes to
our application.
If you replacing the war a required the whole package with the import dynamo DB client statement, it
is reduced that overhead to abide TB three megabyte and it is restricting the import to just the dynamo
DB client and list table command.
Reduce the overhead to less than 100 kilobyte.
So this is very important when it comes to manage your lambda functions, concurrency and the throttling
issues because code start time will reduce dramatically if you use the SDK version three into your Node.js
lambda functions.
And also this is the main reason that most of the enterprise companies choose the Node.js as a Lambda
runtime to gain cold start benefits of this case.
So how we can use version three one interacting natively sources in order to use version three commands,
we import the commands and required a services package client and run the commands using this and methods
using the async await patterns.
So we will use version three commands and we importing the client object and we will send the method
of the commands.
So you can see that every action has commands that can be sent from this client object.
So a version three has set of commands for each add service package to enable you to perform operations
for that services.
After we install a natively service, we can browse the available commands in our projects, so we should
import first and after that we should use the commands with send method.
So let's see the example of Dynamo.
DB If you open the API reference of Dynamo DB example, for example, the for, we will see the example
code.
First of all, we will import the required package.
First of all, we will import client and after that required commands that we will use to interact Photodynamic
TV If you scroll down, we can use the statement how we can call these commands.
As you can see that in here.
First of all, we will create a new command object with passing these parameters.
After that, the only thing is using the send function and passing to command object.
We will use client send and passing to command object in order to interrupt this dynamo DB object.
So in this case we will batch execute statement command and we will send this client object to interact
dynamic DB and this operation is async await patterns that can be handled this operation in a async
asynchronous way.
So as you can see that we have understood that what is needed in a is SDK for JavaScript version three
and why we are using these version three and understand the lambda function called START benefits by
using the version three.