Skip to content
Pablo Rodriguez

Thinking Serverless

Traditional web application deployment in a VPC uses a three-tier architecture:

  • Web Tier: Presentation layer with Application Load Balancer pointing to web servers

    • Multiple Amazon EC2 instances across two availability zones
    • Auto scaling group for high availability
    • Customer manages instance security patches and software updates
    • Amazon CloudWatch monitoring and alarms
  • Application Tier: Business logic layer accessed through another Application Load Balancer

    • High availability design across two AZs with auto scaling group
    • Customer responsible for instance maintenance
  • Data Tier: AWS managed Amazon RDS Multi-AZ database

    • Primary database in one AZ with synchronous replication to secondary in second AZ
    • AWS manages database instances, security patches, and software updates
    • Automatic failover when primary database fails

The multi-tier architecture provides a framework for decoupled and independently scalable application components. However, the network acts as the boundary between tiers and requires creating many undifferentiated application components like message queues and authentication components.

No Server Management

No need to provision, configure, or manage servers. AWS handles the runtime environment and sizing.

Pay-for-Value Services

Cost based on service usage and storage - eliminates paying for unused services.

Continuous Scaling

Automatic scaling based on specific metrics without manual intervention.

Built-in High Availability

Fault tolerance across three AZs and isolated environments for compute resources.

Event-Driven and Microservice Architecture Suitability

Section titled “Event-Driven and Microservice Architecture Suitability”

AWS serverless services are designed for:

  • Event-driven architecture (EDA): Modern pattern built from small, decoupled services that publish, consume, or route events
  • Microservices: Collection of independent, loosely coupled services
  • Event capabilities: Can be invoked by events, emit events, and have built-in event handling
  • AWS Lambda and Lambda@Edge: Event-driven compute service for code functions
  • AWS Fargate: Serverless container solution for Amazon ECS or Amazon EKS
  • API Publishers: Amazon API Gateway (REST/HTTP APIs), AWS AppSync (GraphQL APIs)
  • Messaging: Amazon SNS (publish/subscribe), Amazon SQS (message queuing)
  • Orchestration: AWS Step Functions (workflow orchestrator), Amazon EventBridge (event bus)
  • Amazon S3: Object storage in buckets
  • Amazon EFS: File storage for EC2, Lambda, and containers
  • Amazon DynamoDB: Key-value and document database (single-digit millisecond response)
  • Amazon Aurora Serverless: MySQL/PostgreSQL compatible relational database
  • Amazon Redshift Serverless: Columnar data warehouse with pay-per-use pricing
  • Amazon OpenSearch Serverless: Data search and log analytics
  • Amazon Neptune Serverless: Graph database that scales based on usage
  • Authentication: Amazon Cognito for user pools and external identity providers
  • Web Hosting: AWS Amplify for web and mobile apps
  • Content Delivery: Amazon CloudFront for static web content distribution

Serverless Three-Tier Web Application Pattern

Section titled “Serverless Three-Tier Web Application Pattern”

A common serverless implementation of three-tier architecture:

  1. Web Tier: Amazon CloudFront distributes static front-end from Amazon S3 bucket
  2. Application Tier:
    • Amazon Cognito user pool handles authentication with JWT tokens
    • Amazon API Gateway validates JWT tokens and routes to AWS Lambda functions
    • Lambda functions execute business logic
  3. Data Tier: Amazon DynamoDB for data storage and retrieval

This pattern eliminates server management while maintaining the three-tier architectural benefits. Modern applications are built “serverless-first” to increase agility throughout the application stack.