Skip to content

🏛️ 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 expertsDomain-Driven Design (DDD)
Need maximum flexibilityLow-level builder API
Want rapid developmentHigh-level fluent API
Have complex routing logicStrategy-based patterns
Need to share code across flowsModular/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 point

Pros:

  • 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.cs

Pros:

  • 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.cs

Pros:

  • Maximum reusability
  • Tested, reliable components
  • Easy to share across projects

Cons:

  • Requires careful interface design
  • May overcomplicate simple projects

Preview release - Licensing terms TBD before 1.0