1 00:00:00,125 --> 00:00:01,690 ‫So just a short lecture 2 00:00:01,690 --> 00:00:03,250 ‫on how to scale Kinesis 3 00:00:03,250 --> 00:00:04,280 ‫and for this, we talk about 4 00:00:04,280 --> 00:00:07,490 ‫Shard Splitting and Shard Merging. 5 00:00:07,490 --> 00:00:11,200 ‫So Shard Splitting is used to split a shard into two. 6 00:00:11,200 --> 00:00:12,550 ‫So that means we have more shards 7 00:00:12,550 --> 00:00:15,410 ‫and so it's used to increase the Stream capacity. 8 00:00:15,410 --> 00:00:17,610 ‫So if we add more shards by splitting a shard 9 00:00:17,610 --> 00:00:19,380 ‫we get an extra one megabyte 10 00:00:19,380 --> 00:00:22,090 ‫per second of throughput per shot. 11 00:00:22,090 --> 00:00:22,980 ‫So it's used for example, 12 00:00:22,980 --> 00:00:24,950 ‫when you want to divide a hot shard, 13 00:00:24,950 --> 00:00:27,200 ‫for example, Shard two is very hot, 14 00:00:27,200 --> 00:00:28,520 ‫a lot of data is sent to it. 15 00:00:28,520 --> 00:00:29,990 ‫We're going to split the shard 16 00:00:29,990 --> 00:00:32,940 ‫and we're gonna get shard four and five out of it 17 00:00:32,940 --> 00:00:34,820 ‫and by having the new shards, 18 00:00:34,820 --> 00:00:38,560 ‫we've increased our stream throughput from three megabytes 19 00:00:38,560 --> 00:00:41,490 ‫per second to four megabytes per second. 20 00:00:41,490 --> 00:00:43,400 ‫So we've increased the capacity of course 21 00:00:43,400 --> 00:00:45,740 ‫but because we are being built in terms 22 00:00:45,740 --> 00:00:47,440 ‫of how many shards we have in our stream 23 00:00:47,440 --> 00:00:50,580 ‫we've also increased the cost of our Kinesis Data Stream . 24 00:00:50,580 --> 00:00:52,440 ‫The old shard is going to be closed 25 00:00:52,440 --> 00:00:55,270 ‫or Shard two will not be written two anymore 26 00:00:55,270 --> 00:00:59,330 ‫and the old data will be expired after some time. 27 00:00:59,330 --> 00:01:01,700 ‫So depending on what your retention period is 28 00:01:01,700 --> 00:01:05,030 ‫between one to 365 days, you will have to wait this long. 29 00:01:05,030 --> 00:01:06,330 ‫Then the data is expired 30 00:01:06,330 --> 00:01:09,490 ‫and then finally, the shard will be deleted. 31 00:01:09,490 --> 00:01:11,930 ‫There is no auto-scaling in Kinesis Data Streams 32 00:01:11,930 --> 00:01:16,360 ‫although you can find a way to create your own auto-scaling 33 00:01:16,360 --> 00:01:18,140 ‫and there is a solution architecture for that 34 00:01:18,140 --> 00:01:20,280 ‫but there's no setting to do auto-scaling 35 00:01:20,280 --> 00:01:22,700 ‫with Kinesis Data Streams and so it is 36 00:01:22,700 --> 00:01:26,220 ‫for you to manually increase or decrease capacity. 37 00:01:26,220 --> 00:01:29,140 ‫And you cannot split a shard into more than two 38 00:01:29,140 --> 00:01:31,250 ‫shards in a single operation. 39 00:01:31,250 --> 00:01:32,320 ‫If you wanted to do so, 40 00:01:32,320 --> 00:01:35,170 ‫you will need to do many different Shards Splitting. 41 00:01:35,170 --> 00:01:36,890 ‫Now the opposite operation of 42 00:01:36,890 --> 00:01:39,120 ‫Shard Splitting is Merging Shards . 43 00:01:39,120 --> 00:01:40,710 ‫So you realize that you want to decrease 44 00:01:40,710 --> 00:01:42,450 ‫from capacity and save costs. 45 00:01:42,450 --> 00:01:44,120 ‫In this case, you can group two shards 46 00:01:44,120 --> 00:01:46,540 ‫that have low traffic so cold shards 47 00:01:46,540 --> 00:01:49,970 ‫and you're going to merge them together into a new shard. 48 00:01:49,970 --> 00:01:51,500 ‫So in this example, Shard one 49 00:01:51,500 --> 00:01:54,850 ‫and four are merged into Shard six 50 00:01:54,850 --> 00:01:57,540 ‫and this is used to decrease capacity and the cost. 51 00:01:57,540 --> 00:01:59,950 ‫Then the old shard again, will be closed for rights 52 00:01:59,950 --> 00:02:02,450 ‫and they will be deleted once the data has expired 53 00:02:02,450 --> 00:02:03,530 ‫within the shards. 54 00:02:03,530 --> 00:02:04,520 ‫You can not emerge more 55 00:02:04,520 --> 00:02:06,810 ‫than two shards in a single operation 56 00:02:06,810 --> 00:02:09,430 ‫and with Shard Splitting and Shards Merging 57 00:02:09,430 --> 00:02:12,470 ‫you've seen how to scale up and down Kinesis. 58 00:02:12,470 --> 00:02:13,970 ‫That's it, that's all you need to know. 59 00:02:13,970 --> 00:02:14,950 ‫I hope you liked this lecture 60 00:02:14,950 --> 00:02:16,900 ‫and I will see you in the next lecture.