☁️Infrastructure Guidance

Cloud deployment options and infrastructure requirements for AskGov

This guide provides cloud-agnostic infrastructure guidance for deploying AskGov in production environments. We focus on AskGov-specific requirements rather than general cloud setup instructions.

circle-info

For AWS users: See our detailed AWS Production Deployment guide for specific instructions.

Architecture Overview

High-Level Architecture

spinner

Component Requirements

Component
Purpose
AskGov-Specific Needs

Load Balancer

Traffic distribution, SSL termination

Session affinity not required (stateless)

App Servers

Remix application

Node.js 20+, horizontal scaling

Database

Primary data store

PostgreSQL 14+ or CockroachDB

Weaviate

Vector search for Q&A

Requires 4GB+ RAM for vectorization

Redis

Caching and rate limiting

Session storage, search results cache

Infrastructure Sizing

Deployment Guidance

Small deployments (< 100k citizens):

  • Start with minimal resources

  • Single instances may be sufficient initially

  • Monitor and scale as usage grows

Medium deployments (100k - 1M citizens):

  • Multiple app server instances for redundancy

  • Consider database clustering

  • Implement caching layer

Large deployments (> 1M citizens):

  • Full high-availability setup

  • Multiple instances of each component

  • Consider geographic distribution

Key Principle: Start small and scale based on actual usage metrics rather than predictions. Most deployments can begin with modest resources and grow as needed.

Cloud Provider Quick Reference

Service Mapping

AskGov Component
AWS
Azure
GCP
On-Premise

App Servers

ECS Fargate / EC2

App Service / AKS

Cloud Run / GKE

Docker / VMs

Load Balancer

ALB

Application Gateway

Cloud Load Balancing

Nginx / HAProxy

Database

RDS PostgreSQL

Database for PostgreSQL

Cloud SQL

PostgreSQL / CockroachDB

Weaviate

EC2

VMs

Compute Engine

Docker / VMs

Redis

ElastiCache

Azure Cache

Memorystore

Redis

Storage

S3

Blob Storage

Cloud Storage

MinIO / NFS

Secrets

Secrets Manager

Key Vault

Secret Manager

Vault / Encrypted files

Key Considerations by Provider

AWS

  • Use RDS for simpler setup, EC2 for CockroachDB

  • Weaviate can be self-managed and host on AWS yourself, or can go for managed option

  • Consider Fargate for serverless container management

Azure

  • App Service provides easy PaaS deployment

  • Weaviate needs VMs or AKS

  • Consider Azure Database for PostgreSQL Flexible Server

GCP

  • Cloud Run works well for containerized AskGov

  • Weaviate requires Compute Engine

  • Cloud SQL supports PostgreSQL with automatic backups

On-Premise

  • Docker Compose for simple deployments

  • Minimum 3 servers for high availability

  • Consider OpenShift or Rancher for container orchestration

TODO: format with cards

Docker Deployment

Simple Docker Compose Setup

Network Architecture

Security Zones

spinner

Essential Firewall Rules

TODO: maybe not needed, can remove

Source
Destination
Port
Purpose

Internet

Load Balancer

443

HTTPS access

Load Balancer

App Servers

8080

Application

App Servers

Database

5432/26257

PostgreSQL/CockroachDB

App Servers

Redis

6379

Cache

App Servers

Weaviate

8080

Search

High Availability Essentials

Minimum HA Setup

  • Application: At least 2 instances across availability zones

  • Database: 3-node cluster (odd number for quorum)

  • Redis: Primary with at least one replica

  • Weaviate: Can start with single instance, scale as needed

Database HA Options

PostgreSQL with Streaming Replication

  • Primary + 2 standby servers

  • Automatic failover with Patroni or similar

  • Point-in-time recovery capability

CockroachDB (Recommended for HA)

  • Built-in distributed architecture

  • Automatic failover and rebalancing

  • No SPOF

Monitoring Essentials

Key Metrics for AskGov

Metric
Why It Matters
Alert Threshold Examples

Question Creation Rate

User engagement

Sudden drops

Search Response Time

User experience

> 1 second

Answer Feedback Ratio

Content quality

< 60% positive

Database Connection Pool

Performance bottleneck

> 80% utilized

Weaviate Query Time

Search performance

> 500ms p95

Redis Hit Rate

Cache effectiveness

< 80%

  • Metrics: Prometheus + Grafana (or cloud provider equivalents)

  • Logs: ELK Stack or cloud logging services

  • APM: Datadog, New Relic, or open-source alternatives

  • Uptime: External monitoring service


circle-check

Last updated

Was this helpful?