I'm currently implementing a booking solution that provides the user to send booking requests from their phone and the vendor receiving it on their cash desk software.
I have setup (highlighting only the necessary components) DynamoDB as a database, a websocket connection on API Gateway and a lambda connected both to the API Gateway API and DynamoDB streams.
Giving these two scenarios: User updates a booking -> dynamo entity gets updated -> stream sends it to lambda -> lambda sends it to WS
Vendor updates booking -> dynamo entity gets updated
The problem I'm facing is of course that the vendor cash desk software will receive the update event even when generated by himself, which he wouldn't need since he was the one who sent the update. Is this something I should prevent happening?
Adding a 'synced' flag would remove this issue but would imply making an additional save operation every time I send the order to the cash desk software
User updates -> save entity with 'synced' false -> sends message to cash desk software -> save entity with 'synced' to true
I'm not sure not being an expert on this kind of architecture and can't see what could be the issues I might face in the long run