One application, three shapes
One deployment
Simple to build, test and deploy, but every change ships the whole application and everything scales together.
Monolith or microservices?
Monolithic architecture
Single, unified codebase and deployment unit. All components are tightly coupled and deployed together.
Advantages
- Simple to develop and deploy initially
- Easier debugging and testing
- Better performance (no network latency)
- Lower operational complexity
Challenges
- Difficult to scale specific components
- Large codebase becomes hard to maintain
- Long deployment cycles
- Technology stack lock-in
When to use: Small to medium applications, startups, MVPs, teams with limited DevOps maturity
Microservices architecture
Application composed of small, independently deployable services. Each service owns its data and communicates via APIs or messages. Learn more about microservices on Azure.
Advantages
- Independent deployment and scaling
- Technology diversity per service
- Fault isolation (one service failure doesn't crash all)
- Team autonomy and parallel development
Challenges
- Complex distributed system management
- Network latency and reliability concerns
- Distributed transactions and data consistency
- Operational overhead (monitoring, logging)
When to use: Large enterprises, high-scale applications, teams with DevOps expertise, polyglot requirements
Other architecture styles
Event-driven architecture
Systems communicate through events (state changes). Producers publish events; consumers react asynchronously. Enables loose coupling and real-time processing.
- Event notification: Lightweight events signaling that something happened
- Event-carried state transfer: Events contain all necessary data
- Event sourcing: Store all state changes as immutable events
- CQRS: Separate read and write models with event synchronization
Azure services: Event Grid, Event Hubs, Service Bus, Cosmos DB change feed
Layered (N-tier) architecture
Classic pattern organizing code into horizontal layers with dependencies flowing downward.
- Presentation layer: UI, controllers, view models
- Business logic layer: Domain models, business rules, workflows
- Data access layer: Repositories, ORMs, database contexts
- Cross-cutting concerns: Logging, caching, authentication
When to use: Traditional enterprise applications, well-understood domains, teams familiar with layered approach
Hexagonal architecture (ports & adapters)
Business logic at the center, external dependencies (databases, APIs, UI) as adapters. Ports define contracts, adapters implement them.
- Core domain: Pure business logic, no framework dependencies
- Ports: Interfaces defining how external world interacts with core
- Adapters: Implementations for databases, web APIs, message queues
- Benefits: Testability, technology independence, clear boundaries
Serverless architecture
Event-driven, auto-scaling compute without server management. Pay only for execution time.
- Azure Functions: HTTP triggers, timers, queue/blob triggers
- Logic Apps: Workflow orchestration with visual designer
- Durable Functions: Stateful workflows with checkpointing
- API Management: Gateway for serverless APIs
When to use: Variable workloads, event processing, cost-sensitive scenarios, rapid prototyping