🏛️ Architecture Patterns Guide
Choosing Your Architecture Approach
When building an Amazon Connect contact center with Switchboard, you have several architecture patterns to choose from. This guide helps you understand the tradeoffs and pick what works best for your team.
Quick Decision Guide
| If you... | Consider... |
|---|---|
| Have a small team (1-3 devs) | Simple layered architecture |
| Have a large team with domain experts | Domain-Driven Design (DDD) |
| Need maximum flexibility | Low-level builder API |
| Want rapid development | High-level fluent API |
| Have complex routing logic | Strategy-based patterns |
| Need to share code across flows | Modular/composite patterns |
Architecture Approaches
1. Simple Layered Architecture
Best for: Small teams, straightforward contact centers
Organize your code by resource type:
src/
├── Flows/ # All contact flows
├── Queues/ # All queues
├── Hours/ # Hours of operation
├── Lambdas/ # Custom functions
└── Program.cs # Entry pointPros:
- Easy to understand and navigate
- Low cognitive overhead
- Quick to get started
Cons:
- Doesn't scale well to large projects
- Hard to see business domain relationships
2. Domain-Driven Design (DDD)
Best for: Large teams, complex business logic
Organize by business domain:
src/
├── Domains/
│ ├── Sales/ # Sales team resources
│ │ ├── Flows/
│ │ ├── Queues/
│ │ └── Lambdas/
│ ├── Support/ # Support team resources
│ │ ├── Flows/
│ │ ├── Queues/
│ │ └── Lambdas/
│ └── Billing/ # Billing team resources
├── Shared/ # Cross-cutting concerns
└── Program.csPros:
- Clear business boundaries
- Teams can own domains independently
- Scales well to large organizations
- Business logic stays together
Cons:
- More upfront planning required
- Steeper learning curve
- May have some duplication
3. Module-Based Architecture
Best for: Reusable components, multiple contact centers
Organize by reusable modules:
src/
├── Modules/
│ ├── Authentication/ # Customer auth module
│ ├── Voicemail/ # Voicemail module
│ ├── Callback/ # Callback module
│ └── Survey/ # Post-call survey
├── Flows/ # Flows that use modules
└── Program.csPros:
- Maximum reusability
- Tested, reliable components
- Easy to share across projects
Cons:
- Requires careful interface design
- May overcomplicate simple projects