Simpler.Grants.gov Public Wiki
Grants.govSimpler.Grants.govGitHubDiscourse
  • 👋Welcome
  • GET INVOLVED
    • Why open source?
    • How to contribute code
    • How to file issues
      • Report a bug
      • Request a feature
      • Report a security vulnerability
    • Community guidelines
      • Code of Conduct
      • Reporting and removing content
      • Incident response protocol
    • Community events
      • Fall 2024 Coding Challenge
        • Event Submissions & Winners
      • Spring 2025 Collaborative Coding Challenge
        • Event Submissions & Winners
    • Communication channels
  • Product
    • Roadmap
    • Deliverables
      • 🏁Static site soft launch
      • 🏁Static site public launch
      • 🏁GET Opportunities
      • 🏁Open source onboarding
      • 🏁Co-Design Group planning
    • Decisions
      • ADR Template
      • ADRs
        • Dedicated Forum for Simpler.Grants.gov Community
        • Recording Architecture Decisions
        • Task Runner for the CI / CD Pipeline
        • API Language
        • Use Figma for design prototyping
        • ADR: Chat
        • DB Choices
        • API Framework and Libraries
        • Back-end Code Quality Tools
        • Front-end Language
        • Communications Tooling: Wiki Platform
        • Use Mural for design diagrams and whiteboarding
        • Ticket Tracking
        • Front-end Framework
        • Front-end Code Quality Tools
        • Front-end Testing & Coverage
        • Backend API Type
        • Front-end Testing & Coverage
        • Deployment Strategy
        • Use U.S. Web Design System for components and utility classes
        • FE server rendering
        • Use NPM over Yarn Architectural Decision Records
        • U.S. Web Design System in React
        • Communications Tooling: Video Conferencing
        • Back-end Production Server
        • Communications Tooling: Analytics Platform
        • Commit and Branch Conventions and Release Workflow
        • Cloud Platform to Host the Project
        • Infrastructure as Code Tool
        • Data Replication Strategy & Tool
        • HHS Communications Site
        • Communications Tooling: Email Marketing
        • Communications Tooling: Listserv
        • Use Ethnio for design research
        • Uptime Monitoring
        • Database Migrations
        • 30k ft deliverable reporting strategy
        • Public measurement dashboard architecture
        • Method and technology for "Contact Us" CTA
        • E2E / Integration Testing Framework
        • Logging and Monitoring Platform
        • Dashboard Data Storage
        • Dashboard Data Tool
        • Search Engine
        • Document Storage
        • Document Sharing
        • Internal Wiki ADR
        • Shared Team Calendar Platform
        • Cross-Program Team Health Survey Tool
        • Adding Slack Users to SimplerGrants Slack Workspace
        • Repo organization
        • Internal knowledge management
        • Migrate Existing API Consumers
      • Infra
        • Use markdown architectural decision records
        • CI/CD interface
        • Use custom implementation of GitHub OIDC
        • Manage ECR in prod account module
        • Separate terraform backend configs into separate config files
        • Database module design
        • Provision database users with serverless function
        • Database migration architecture
        • Consolidate infra config from tfvars files into config module
        • Environment use cases
        • Production networking long term state
    • Analytics
      • Open source community metrics
      • API metrics
  • DESIGN & RESEARCH
    • Brand guidelines
      • Logo
      • Colors
      • Grid and composition
      • Typography
      • Iconography
      • Photos and illustrations
    • Content guidelines
      • Voice and tone
    • User research
      • Grants.gov archetypes
  • REFERENCES
    • Glossary
  • How to edit the wiki
Powered by GitBook
On this page
  • Context and Problem Statement
  • Decision Drivers
  • Options Considered
  • Decision Outcome
  • Pros and Cons of the Options
  • ECS with Fargate or EC2 launch type
  • S3
  • Lambda
  • Links

Was this helpful?

Edit on GitHub
  1. Product
  2. Decisions
  3. ADRs

Deployment Strategy

PreviousFront-end Testing & CoverageNextUse U.S. Web Design System for components and utility classes

Last updated 1 month ago

Was this helpful?

  • Status: Accepted

  • Last Modified: 2023-07-20

  • Related Issue:

  • Deciders: Lucas, Daphne, Sammy, Billy

  • Tags: ADR

Context and Problem Statement

We need to choose a deployment strategy for the Grants.gov modernization effort that suits our core needs and will host our entire application ecosystem, both the API and frontend layers.

Decision Drivers

  • Reliable: The chosen deployment strategy should be able to offer at least 99.99% monthly application uptime with consistent results.

  • Scalable: We should be able to scale our deployment to meet the demands of our containers while remaining lean.

  • Compatible with IaC: The strategy should be compatible with Terraform as our chosen Infrastructure as Code solution.

  • Ease of use: We prioritize ease of use as well as cost-efficiency. We understand that engineering time spent managing details of infrastructure is a trade off to less prescriptive strategies.

  • Growth oriented: As our applications evolve, we need our chosen deployment strategy to grow with us or be easily swapped.

Options Considered

  • ECS with Fargate or EC2 launch type

  • S3

  • Lambda

Decision Outcome

Chosen option: ECS with Fargate launch type, because it offers the most consistent and easy to use deployment strategy to host both the front-end and API layers of the Grants.gov modernization. Current template infrastructure integrates with ECS and the Fargate launch type.

Pros and Cons of the Options

ECS with Fargate or EC2 launch type

Fargate

Fargate is an AWS serverless compute tool for containers.

  • Pros

    • Run containers without having to manage or provision EC2 instances

    • Removes operational overhead of scaling, patching, securing and managing servers

    • Integrates with AWS Cloudwatch or other third party metrics tools

    • Secure, running in dedicated runtime environments

    • Scalable means pay for usage, not for reserved or wasted space

    • Fargate Spot instances further reduce costs and are viable for our use-case

  • Cons

    • Offers less granular flexibility, favoring less DevOps overhead

    • Nontrivial to gain direct access to a particular Fargate task

EC2

Secure and resizable compute capacity for virtually any workload.

  • Pros

    • Ability to granularly manage and provision resources of environment

    • Can connect to an EC2 instance easily via SSH if necessary

    • Many instance types to choose from to meet our needs

    • Reliable, scalable and on-demand

    • Compatible with many other tools in the AWS arsenal

  • Cons

    • Requires detailed management and provisioning of environment

    • Mismanagement of environment can greatly increased costs

    • Less friendly for engineering teams that are not DevOps dedicated

A note on ECS: It is possible to run EC2 instances to host our Docker containers without using ECS orchestration. However, since ECS is a free service provided by AWS and we would only pay for the underlying resources, forgoing ECS and an orchestration tool isn't an appealing strategy.

S3

Object storage built to retrieve any amount of data from anywhere.

  • Pros

    • Suitable to host static websites, our current use-case

    • Highly scalable with unlimited storage space

    • Extremely cost-effective with pay-as-needed pricing model

    • Highly durable with storage redundancy in multiple locations

    • Easy to use interface with static website hosting options

  • Cons

    • Only suitable to host static websites, making it a difficult choice for a rapidly growing front-end in development

    • Limited customization options

Lambda

Run code without thinking about servers or clusters

  • Pros

    • Auto-scaling has limitations, and pay-per-request methodology is ultra lean

    • No need for redundancy in multiple Availability Zones

    • Run code without provisioning or managing any infrastructure

    • Scalable to meet high demand

  • Cons

    • Ineffective for long-running processes, maximum duration of 15 minutes

    • Deployment package maximum size is 250 MB

    • Max Docker image size is 10 GB

    • Deploying serverless applications might require project restructuring or additional tools and ramp up

    • Less performant than alternatives with lack of dedicated resources

Links

Possible that cost is higher than EC2 launch type ()

Interesting read on building a static React front-end hosted in S3 with Lambda back-end:

187
Theoretical cost optimization by Amazon ECS launch type: Fargate vs EC2
Server-side rendering for React in AWS Lambda