From Zero to Serverless:

Building a Real-Time Leaderboard with AWS SAM

Calvin Hendryx-Parker, CTO

Six Feet Up

Why AWS SAM?

Simplifying Serverless Development

What is AWS SAM?

  • Serverless Application Model
  • Open-source framework for building serverless applications
  • Extension of AWS CloudFormation
  • Provides simplified syntax for defining serverless resources

Key Benefits of AWS SAM

Developer Productivity

  • Write less boilerplate
  • Built-in best practices
  • Local testing and debugging

Infrastructure as Code

  • Version control your infrastructure
  • Consistent deployments
  • Easy rollbacks

Local Development

  • Test Lambda functions locally
  • Simulate API Gateway endpoints
  • Debug step-by-step

Real World Use Cases

  • API Development
    • REST APIs with Lambda + API Gateway
    • Simplified API definitions

Real World Use Cases (cont.)

  • Event Processing
    • S3 event handlers
    • SQS/SNS processors
    • CloudWatch Events

Real World Use Cases (cont.)

  • Web Applications
    • Serverless backends
    • Static website hosting
    • Authentication flows

SAM vs Raw CloudFormation

# Traditional CloudFormation
Resources:
  MyFunction:
    Type: AWS::Lambda::Function
    Properties:
      Handler: index.handler
      Role: !GetAtt LambdaExecutionRole.Arn
      Code:
        S3Bucket: my-bucket
        S3Key: my-function.zip
      Runtime: nodejs18.x

# SAM Equivalent
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs18.x

Getting Started

  1. Install SAM CLI

    brew install aws-sam-cli
  2. Initialize a Project

    sam init
  3. Local Development

    sam local start-api
  4. Deploy

    sam deploy --guided

Hello World

Why Choose SAM?

Simplified Resource Definitions
Local Testing Capabilities
AWS Best Practices Built-in
Free and Open Source
Native AWS Integration
Active Community

Scaf Leaderboard Example

Resources

Talk To Me

📩
🤝 https://linkedin.com/in/calvinhp
✖️ @calvinhp
🐘 @calvinhp@fosstodon.org
🦋 @calvinhp.com