Skip to content

ADR-001: SNS for All Inter-Module and Intra-Module Communication

Status

Accepted

Date

2024-01-01

Context

Service modules need to communicate processing state and trigger downstream actions. Options considered: 1. Direct Lambda invocation (synchronous) 2. SNS/SQS for cross-module, direct calls for intra-module 3. SNS/SQS for everything (both cross-module and intra-module) 4. EventBridge for event routing

Decision

Use AWS SNS for ALL event communication — both cross-module and intra-module. Differentiate by event type naming, not by transport mechanism.

SNS filter policies route events to the correct SQS queues. Each module's Lambda functions consume from their own SQS queues.

Consequences

Positive

  • One transport pattern to learn, deploy, and monitor
  • Intra-module events can be promoted to cross-module by adding subscribers
  • Consistent retry, DLQ, and observability everywhere
  • SNS filter policies handle routing without application-level code
  • Built-in fan-out when multiple modules need the same event

Negative

  • Higher latency than direct invocation (~50-100ms SNS/SQS overhead)
  • Eventual consistency — no synchronous request/response
  • Message size limit (256KB) requires S3 for large payloads
  • At-least-once delivery requires idempotent handlers everywhere

Risks

  • SNS topic becomes a single point of failure (mitigated by SNS's built-in redundancy)
  • Filter policy complexity grows with number of event types
  • Debugging event flows requires distributed tracing
Ask the Architecture ×

Ask questions about Nextpoint architecture, patterns, rules, or any module. Powered by Claude Opus 4.6.