🗼Infrastructure Guidance

This document provides proven deployment patterns from FormSG production experience, simplified for government teams to adapt to their specific environments.

FormSG Architecture Reference

Understanding FormSG's complete architecture helps you plan which components to migrate and which to replace:

When to Use This Guide

Use the guides at Deployment wherever possible, this guide covers

  • Other cloud deployment not covered like GCP, Azure, or other cloud environment

  • On-premise deployment

  • Understanding FormSG architecture for platform adaptation

What This Guide Covers

  1. Infrastructure Patterns - What FormSG needs from your platform

  2. Migration Approach - How to implement it step by step

  3. Getting Started - Next steps for your deployment

Platform Context

FormSG was architected for AWS and that's where we have production experience. While the architecture is cloud-agnostic in theory, we haven't tested other cloud deployments.

What We Know

✅ The architecture uses standard patterns (containers, MongoDB, S3-compatible storage) ✅ Other governments have likely deployed on different clouds 📋 This guide provides architectural patterns for adaptation to your platform

Infrastructure Patterns

This section covers FormSG's infrastructure requirements in a cloud-agnostic way that you can adapt to your specific tools and environments.

Core Deployment Patterns

What it does: Runs FormSG application with auto-scaling and health monitoring

Requirements:

  • Container image: Build from FormSG source or use your registry

  • Port: 5000 (internal application port)

  • Health check: /api/v3/admin/forms endpoint

  • Auto-scaling: 2-10 instances based on CPU utilization (70% threshold)

  • Environment variables: NODE_ENV, DB_HOST, SESSION_SECRET

  • Load balancer: For high availability and traffic distribution

Adapt for your environment:

  • Adjust scaling parameters based on expected load

  • Configure environment variables in your secrets management system

Migration Approach

FormSG uses standard technologies (Docker, MongoDB, S3-compatible storage, SMTP) that exist on all major clouds:

  • AWS ECS → Any container service

  • AWS S3 → Any object storage with S3 API

  • MongoDB Atlas → Any MongoDB-compatible database

  • AWS SES → Any SMTP service

Migration Phases and Validation

1

Phase 1: Infrastructure Foundation

Objective: Establish core infrastructure components

Activities:

  • Set up container orchestration platform

  • Deploy object storage solution

  • Configure networking and load balancing

  • Establish monitoring and logging

Validation:

2

Phase 2: Data Services

Objective: Migrate database and configure data persistence

Activities:

  • Deploy MongoDB-compatible database

  • Configure connection strings and authentication

  • Set up backup and disaster recovery

  • Test data migration procedures

Validation:

3

Phase 3: Application Services

Objective: Configure external service integrations

Activities:

  • Configure email service integration

  • Set up SMS service (if required)

  • Configure identity provider integration

  • Test all communication channels

Validation:

4

Phase 4: Security and Compliance

Objective: Implement security controls and validate compliance

Activities:

  • Configure TLS/SSL certificates

  • Implement access controls and secrets management

  • Set up security monitoring and alerting

  • Conduct security testing

Validation:

Last updated

Was this helpful?