I am trying to learn aws kinesis streams ,and as per aws kinesis streams documentation. Each shard ingests up to 1MB/sec or 1000 records/sec, and allows reads up to 2MB/sec and 5 transaction per second for reads.
Therefore my doubt is:: If my data packet size is 250kb ,and only 1MB write per shard is allowed, then to get a throughput of 200 message per second ,i would be needing approx.50 shards(49 as per aws shard calculator,given in picture below).But while using shard-calculator provided by AWS,it also asks for the number of consumers, which if I provide,(say 3 consumers),it increases the shard count from 50 to 74,NOw my question is ,how does adding consumers alter the count of shards required?
So Could someone please explain the logic here. Thanks.
AWS has defined the below formula to calculate the number of shards
Number_of_shards = max(incoming_write_bandwidth_in_KiB/1024, outgoing_read_bandwidth_in_KiB/2048)
In your case,
incoming_write_bandwidth_in_KiB =
avg.data size in kb * records per second
= 250 * 200 = 50000
outgoing_read_bandwidth_in_KiB =
incoming_write_bandwidth_in_KiB * consumers
= 50000 * 3 = 150000
So, No.of.Shards
= max (50000/1024,150000/2048)
= max (48.8 , 73.2)
= 73.2
and hence 74 shards.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.