I'm working on an event-driven system using AWS SQS and facing a design decision when sending commands between services. The command triggers an operation in the receiving service, and that operation requires multiple pieces of data — potentially 15+ parameters.
The dilemma:
- Should the SQS message contain all the necessary information for the command to be processed (i.e. fully self-contained payload)? OR
- Only include a reference ID, so that the receiving service can fetch the data it needs (e.g. from a shared database or API)?
I’m trying to keep the architecture clean, scalable, and maintainable
My gut: It feels messy to cram all parameters into a single message, but I'm aware of introducing latency and tight coupling by forcing the consumer to retrieve external data.
What’s the most robust and clean approach in your experience? Any best practices for hybrid strategies?