I'm quite a newbe in microservices and Event-Sourcing and I was trying to figure out a way to deploy a whole system on AWS.
As far as I know there are two ways to implement an Event-Driven architecture:
- Using AWS Kinesis Data Stream
- Using AWS SNS + SQS
So my base strategy is that every command is converted to an event which is stored in DynamoDB and exploit DynamoDB Streams to notify other microservices about a new event. But how? Which of the previous two solutions should I use?
The first one has the advanteges of:
- Message ordering
- At least one delivery
But the disadvantages are quite problematic:
- No built-in autoscaling (you can achieve it using triggers)
- No message visibility functionality (apparently, asking to confirm that)
- No topic subscription
- Very strict read transactions: you can improve it using multiple shards from what I read here you must have a not well defined number of lamdas with different invocation priorities and a not well defined strategy to avoid duplicate processing across multiple instances of the same microservice.
The second one has the advanteges of:
- Is completely managed
- Very high TPS
- Topic subscriptions
- Message visibility functionality
Drawbacks:
- SQS messages are best-effort ordering, still no idea of what they means. It says "A standard queue makes a best effort to preserve the order of messages, but more than one copy of a message might be delivered out of order". Does it means that giving n copies of a message the first copy is delivered in order while the others are delivered unordered compared to the other messages' copies? Or "more that one" could be "all"?
A very big thanks for every kind of advice!