1
00:00:00,240 --> 00:00:08,130
In this video we are going to learn what is Neve in the Willis SDK for JavaScript version three and

2
00:00:08,130 --> 00:00:14,160
why we are using the version three and understand the lambda function called START benefits when using

3
00:00:14,160 --> 00:00:15,120
the version three.

4
00:00:16,140 --> 00:00:22,890
Basically the SDK for JavaScript version three is rewrite of the version two with some great new features.

5
00:00:23,280 --> 00:00:30,120
As with the Virgin tool, it enables you to easily work on the services but has a modular architecture

6
00:00:30,120 --> 00:00:32,760
with a separate package for each services.

7
00:00:33,180 --> 00:00:39,540
It also includes many frequently requested features, such as a first class typescript support and a

8
00:00:39,540 --> 00:00:40,920
new middleweight stake.

9
00:00:41,670 --> 00:00:49,350
So we can say that Virgin three of the SDK for JavaScript contains these new features which are the

10
00:00:49,350 --> 00:00:51,060
modularized packages.

11
00:00:51,090 --> 00:00:57,450
Users can now use a separate package for each service, and there's a new middleware stack.

12
00:00:57,480 --> 00:01:02,970
Users can now use a middleware stack to control the lifecycle of operational call.

13
00:01:03,210 --> 00:01:09,690
In addition, the SDK is written in triplicate, which has many advantages, such as the static typing.

14
00:01:11,070 --> 00:01:16,350
So let's elaborate these items and let's focus on the modularized package.

15
00:01:16,380 --> 00:01:19,230
Version two of the SDK for JavaScript.

16
00:01:19,230 --> 00:01:27,960
Version two require you to use the entire Adobe SDK and see the code block in here where A is required.

17
00:01:27,960 --> 00:01:35,160
The entire package, which is the SDK and loading the entire SDK isn't an issue if your application

18
00:01:35,160 --> 00:01:36,960
is using many services.

19
00:01:36,960 --> 00:01:44,040
However, if you need to use only a few Adobe services, it means increasing the size of your application

20
00:01:44,040 --> 00:01:46,170
with the code you don't need to use.

21
00:01:46,410 --> 00:01:53,730
So but in version three, we can load and use only individual services that we need.

22
00:01:53,730 --> 00:01:56,340
See the example Dynamo DB in here.

23
00:01:56,370 --> 00:02:03,960
We can use the import statement for Dynamo DB client from the Dynamo DB Client Libraries and this gives

24
00:02:03,960 --> 00:02:08,840
you access to Amazon Dynamo DB Client object to interact with the Amazon Dynamo DB on there.

25
00:02:09,300 --> 00:02:15,660
So that means not only can you load and use individual services, but you can also load and use only

26
00:02:15,660 --> 00:02:17,580
the service commands that we need.

27
00:02:17,580 --> 00:02:20,010
So you can see the example called in.

28
00:02:20,030 --> 00:02:22,440
Here is the import statement.

29
00:02:22,470 --> 00:02:28,440
This gives us the access to Dynamo DB client and the list table commands in here.

30
00:02:28,440 --> 00:02:35,700
So basically we need only the listing tables from Dynamo DB so we can specifically download the only

31
00:02:35,700 --> 00:02:40,080
required Dynamo DB libraries and a special release table command.

32
00:02:41,460 --> 00:02:46,940
So this package management with version three, we install only required package and this comes with

33
00:02:46,940 --> 00:02:50,910
a great benefit which is the size of the code decrease dramatically.

34
00:02:50,940 --> 00:02:52,460
Let's give an example.

35
00:02:52,470 --> 00:02:58,950
If you compare to listing tables from Dynamic DB, which using version two and version three, we can

36
00:02:58,950 --> 00:03:07,020
say that in version two, it's using the whole package and the SDK package adds about 40 megabytes to

37
00:03:07,020 --> 00:03:08,110
our application.

38
00:03:08,130 --> 00:03:15,840
If you replacing the war a required the whole package with the import dynamo DB client statement, it

39
00:03:15,840 --> 00:03:22,410
is reduced that overhead to abide TB three megabyte and it is restricting the import to just the dynamo

40
00:03:22,410 --> 00:03:24,450
DB client and list table command.

41
00:03:24,510 --> 00:03:28,120
Reduce the overhead to less than 100 kilobyte.

42
00:03:28,140 --> 00:03:35,070
So this is very important when it comes to manage your lambda functions, concurrency and the throttling

43
00:03:35,070 --> 00:03:42,480
issues because code start time will reduce dramatically if you use the SDK version three into your Node.js

44
00:03:42,480 --> 00:03:43,560
lambda functions.

45
00:03:44,190 --> 00:03:49,950
And also this is the main reason that most of the enterprise companies choose the Node.js as a Lambda

46
00:03:49,950 --> 00:03:53,790
runtime to gain cold start benefits of this case.

47
00:03:54,370 --> 00:04:00,550
So how we can use version three one interacting natively sources in order to use version three commands,

48
00:04:00,550 --> 00:04:07,900
we import the commands and required a services package client and run the commands using this and methods

49
00:04:07,900 --> 00:04:10,150
using the async await patterns.

50
00:04:10,570 --> 00:04:18,010
So we will use version three commands and we importing the client object and we will send the method

51
00:04:18,010 --> 00:04:19,090
of the commands.

52
00:04:19,090 --> 00:04:24,940
So you can see that every action has commands that can be sent from this client object.

53
00:04:25,060 --> 00:04:32,230
So a version three has set of commands for each add service package to enable you to perform operations

54
00:04:32,230 --> 00:04:34,000
for that services.

55
00:04:34,300 --> 00:04:41,170
After we install a natively service, we can browse the available commands in our projects, so we should

56
00:04:41,170 --> 00:04:46,270
import first and after that we should use the commands with send method.

57
00:04:46,270 --> 00:04:48,930
So let's see the example of Dynamo.

58
00:04:48,940 --> 00:04:54,580
DB If you open the API reference of Dynamo DB example, for example, the for, we will see the example

59
00:04:54,580 --> 00:04:54,940
code.

60
00:04:54,970 --> 00:04:57,670
First of all, we will import the required package.

61
00:04:57,700 --> 00:05:03,550
First of all, we will import client and after that required commands that we will use to interact Photodynamic

62
00:05:03,550 --> 00:05:12,520
TV If you scroll down, we can use the statement how we can call these commands.

63
00:05:12,700 --> 00:05:14,260
As you can see that in here.

64
00:05:14,290 --> 00:05:20,350
First of all, we will create a new command object with passing these parameters.

65
00:05:20,380 --> 00:05:26,890
After that, the only thing is using the send function and passing to command object.

66
00:05:26,920 --> 00:05:33,640
We will use client send and passing to command object in order to interrupt this dynamo DB object.

67
00:05:33,640 --> 00:05:39,940
So in this case we will batch execute statement command and we will send this client object to interact

68
00:05:39,940 --> 00:05:47,740
dynamic DB and this operation is async await patterns that can be handled this operation in a async

69
00:05:47,830 --> 00:05:48,850
asynchronous way.

70
00:05:48,850 --> 00:05:56,320
So as you can see that we have understood that what is needed in a is SDK for JavaScript version three

71
00:05:56,320 --> 00:06:01,510
and why we are using these version three and understand the lambda function called START benefits by

72
00:06:01,510 --> 00:06:02,680
using the version three.
