1
00:00:00,000 --> 00:00:02,280
<v Instructor>So, let's talk about DynamoDB-DAX</v>

2
00:00:02,280 --> 00:00:04,935
and DAX stands for accelerator.

3
00:00:04,935 --> 00:00:06,926
And so, accelerator means that it's a seamless cache

4
00:00:06,926 --> 00:00:08,854
for DynamoDB and you can enable it

5
00:00:08,854 --> 00:00:10,916
and you don't need to re-write any of your applications.

6
00:00:10,916 --> 00:00:12,246
They work just the same.

7
00:00:12,246 --> 00:00:14,620
But now, all the writes you do to DynamoDB,

8
00:00:14,620 --> 00:00:16,112
they go through DAX.

9
00:00:16,112 --> 00:00:19,864
And DAX basically provides you micro-second latency,

10
00:00:19,864 --> 00:00:22,030
so very low latency in case you have

11
00:00:22,030 --> 00:00:24,292
a cache read or cache query.

12
00:00:24,292 --> 00:00:26,838
So, this is a cache for your reads,

13
00:00:26,838 --> 00:00:28,624
and it solves the Hot Key problems.

14
00:00:28,624 --> 00:00:30,276
So, for example, you have a popular ad

15
00:00:30,276 --> 00:00:32,182
entering a big sale during the year,

16
00:00:32,182 --> 00:00:34,690
and that item is being queried a lot,

17
00:00:34,690 --> 00:00:36,570
so you get too many reads on that item

18
00:00:36,570 --> 00:00:38,028
and you get a Hot Key problem because

19
00:00:38,028 --> 00:00:39,358
you exceed your throughput,

20
00:00:39,358 --> 00:00:41,534
then you put DAX in front of your,

21
00:00:41,534 --> 00:00:43,531
DynamoDB cluster, and all of a sudden

22
00:00:43,531 --> 00:00:45,382
the reads are done from the cache,

23
00:00:45,382 --> 00:00:47,576
and so the problem of the Hot Key is solved.

24
00:00:47,576 --> 00:00:49,676
By default, your items live for

25
00:00:49,676 --> 00:00:51,435
five minutes in your cache.

26
00:00:51,435 --> 00:00:52,972
And you can have up to 10 nodes

27
00:00:52,972 --> 00:00:55,832
in your cache cluster, so you can scale a lot.

28
00:00:55,832 --> 00:00:58,644
It is multi AZ, so you can enable

29
00:00:58,644 --> 00:01:00,772
multiple nodes in multiple availability zones,

30
00:01:00,772 --> 00:01:02,804
and in production it's recommended you have

31
00:01:02,804 --> 00:01:06,374
a minimum of three nodes to enhance that availability.

32
00:01:06,374 --> 00:01:08,155
Finally, just like everything we've seen

33
00:01:08,155 --> 00:01:10,414
DAX is secure, you get encryption at rest

34
00:01:10,414 --> 00:01:13,211
using KMS, you have VPC end points,

35
00:01:13,211 --> 00:01:16,457
you have IAM permissions, and you can use CloudTrail.

36
00:01:16,457 --> 00:01:18,890
So here is your DynamoDB, and you have say,

37
00:01:18,890 --> 00:01:20,811
three tables in your DynamoDB,

38
00:01:20,811 --> 00:01:23,327
and so our applications basically,

39
00:01:23,327 --> 00:01:25,057
instead of talking straight to DynamoDB

40
00:01:25,057 --> 00:01:26,719
they are going to interact with the

41
00:01:26,719 --> 00:01:28,601
Amazon DynamoDB accelerator,

42
00:01:28,601 --> 00:01:30,767
so no code change, just straight interaction

43
00:01:30,767 --> 00:01:33,359
with the DynamoDB accelerator.

44
00:01:33,359 --> 00:01:35,310
The accelerator itself will interact

45
00:01:35,310 --> 00:01:37,219
with your DynamoDB databases,

46
00:01:37,219 --> 00:01:40,155
and it will be smart enough to cache whatever is needed,

47
00:01:40,155 --> 00:01:41,487
whenever it is needed.

48
00:01:41,487 --> 00:01:43,073
So it's a very simple concept,

49
00:01:43,073 --> 00:01:45,809
it's a very easy way to cache some reads,

50
00:01:45,809 --> 00:01:48,688
and improve your application performance at minimal costs.

51
00:01:48,688 --> 00:01:51,223
To enable DAX, nothing easier.

52
00:01:51,223 --> 00:01:53,085
We just go to DAX on the left hand side,

53
00:01:53,085 --> 00:01:55,431
and you have a DAX enabled region for it,

54
00:01:55,431 --> 00:01:57,150
you see this left hand side?

55
00:01:57,150 --> 00:01:58,794
We go to dashboard, and we see we have

56
00:01:58,794 --> 00:02:02,115
no clusters running, but we could create a cluster,

57
00:02:02,115 --> 00:02:04,681
we could name it you say, "mychache,"

58
00:02:04,681 --> 00:02:06,657
and then you specify the type of nodes you want.

59
00:02:06,657 --> 00:02:09,179
So obviously, you can have some very small instances

60
00:02:09,179 --> 00:02:10,975
like t2.small, t2.medium, but you can go

61
00:02:10,975 --> 00:02:13,681
all the way to r4.16xlarge if you have

62
00:02:13,681 --> 00:02:16,996
a very, very heavy application for reads.

63
00:02:16,996 --> 00:02:18,461
You select the cluster size,

64
00:02:18,461 --> 00:02:20,393
so you can go from one to 10 nodes,

65
00:02:20,393 --> 00:02:22,635
and greater nodes gives you better availability,

66
00:02:22,635 --> 00:02:24,857
and better performance for read scale.

67
00:02:24,857 --> 00:02:27,053
You can enable encryption for you data

68
00:02:27,053 --> 00:02:28,725
to be protected at rest.

69
00:02:28,725 --> 00:02:30,593
You need to give an IAM role to DAX,

70
00:02:30,593 --> 00:02:33,645
and this IAM role must be granted the access

71
00:02:33,645 --> 00:02:35,821
to your DynamoDB tables.

72
00:02:35,821 --> 00:02:37,597
Then you need to select a subnet group,

73
00:02:37,597 --> 00:02:39,829
which is where your DAX cluster will be

74
00:02:39,829 --> 00:02:41,483
created in your VPC.

75
00:02:41,483 --> 00:02:44,067
And you can assign some security groups, as well.

76
00:02:44,067 --> 00:02:45,681
Finally for the cluster setting,

77
00:02:45,681 --> 00:02:46,817
you can use a default setting which

78
00:02:46,817 --> 00:02:50,106
gives you a TTL of five minutes,

79
00:02:50,106 --> 00:02:51,593
no preference for availability zones,

80
00:02:51,593 --> 00:02:53,282
no preference for maintenance windows,

81
00:02:53,282 --> 00:02:54,778
so your cluster will be taken down

82
00:02:54,778 --> 00:02:56,922
from time to time, but one node at a time,

83
00:02:56,922 --> 00:02:57,891
and no notification.

84
00:02:57,891 --> 00:02:59,780
But you can change all these things.

85
00:02:59,780 --> 00:03:01,338
I'm not going to go ahead and create this,

86
00:03:01,338 --> 00:03:02,582
because this will cost money

87
00:03:02,582 --> 00:03:04,009
even if you use a t2.small,

88
00:03:04,009 --> 00:03:05,453
DAX is not in the free tier.

89
00:03:05,453 --> 00:03:06,594
But I just wanted to show you how easy

90
00:03:06,594 --> 00:03:09,032
it was to just create a DAX cluster.

91
00:03:09,032 --> 00:03:10,438
So that's it for this lecture,

92
00:03:10,438 --> 00:03:13,113
I hope you liked it, and I will see you in the next lecture.

