So the current setup is a typical event sourced system built on AWS: Lambdas exposed with API Gateway to get the orders (commands), the domain (aggregates) apply some validations after loading the aggregate, publish all events in the event store (DynamoDB).
Where things get interesting! How to react to these events! Some of these events might have direct implications, some are side effects!
Implementation A:We started with having the direct implication (for example, if we have an order, after running the validation we will have an event something like OrderConfirmed and then this event will be used to trigger the rest of the flow! Like _actually_ ordering the item) implemented as lamdbas that listen directly to the DynamoDB Stream! Sounds amazing! Especially with how DynamoDB Streams will collect the events by batches and trigger the lamdba.
The issue with that implementation is that DynamoDB Stream does NOT filter events! Which means if I have flow A and flow B, depending on which event I raise I want my system to react differently, Lambda A and Lambda B will be triggered in both cases, it will be my job to have a filter in these lamdbas, which is obviously not nice to have! And thats the case of the main flow not the side effects (like notifications/emails)