In previous post we've demonstrated Using AWS Kinesis in Go, and Using AWS SQS in Go. In this post we'll review when should we use each of this technologies.
Before going into details, there is one rule of thumb that let you know which technology to use. This might not be always correct, and we should check the details below for the final decision, but this is a very good start point.
Use AWS SQS if the following is required:
- High rate and transparent dynamic scalability of messages processing
- Ordering is not important
- Reading of the same message by several consumers
- Replay of messages
- Ordering is important
Let's dive into the details. We will review each of the characteristics of the technologies, and compare where it better to use one over the other.
Scale
AWS SQS automatically transparently handles dynamic load changes. This means the application automatically adjusts to load changes. This is a huge advantage for AWS SQS.
AWS Kinesis can handle high load but the AWS Kinesis shards and the application needs to be preconfigured with the expected load. Change of the shards amount requires both change of application behavior and a resharding operation, which is definitely not a fun game.
Multiple Consumers
Ordering
Message Size
Throughput
- write 1MB/1000 transactions per second
- read 2MB/2000 transactions per second
AWS Services Integration
Pricing
In general first look on the costs seems to be similar, but the details here matter especially if we plan to process huge amount of data. The costs should be compared based of the amount of shards we might need for AWS Kinesis. There is not guideline here (sorry...), we will need to plan the entire solution to get an estimation of the cost.
No comments:
Post a Comment