Infrastructure Scaling Plan
Roadmap to scale ForaCity to every city, county, and state in the United States.
Target Scale: United States
Phased Rollout
Automated ingestion pipelines: NetFile (all SD County filers), CivicPlus/Granicus (agendas), ArcGIS (all SD districts). Jurisdiction-scoped data isolation with shared analytics.
Data Ingestion Layer
Processing & Compliance Layer
Storage Layer
Application Layer
Presentation Layer
Cost Projections
| Phase | Infra / mo | Data / mo | Team |
|---|---|---|---|
| 1. Escondido | $50 | $0 | 1 dev |
| 2. SD County | $200 | $100 | 2-3 devs |
| 3. California | $2K | $1K | 5-8 devs |
| 4. Multi-State | $10K | $5K | 15-20 |
| 5. National | $50K | $20K | 30-50 |
Key Architecture Decisions
Multi-Tenant vs. Multi-Instance
Shared infrastructure reduces cost per jurisdiction. Row-level security via Drizzle query filters. Shard by region at Phase 3+.
Monorepo vs. Microservices
tRPC routers act as service boundaries. Split to microservices only when team size exceeds 15. Current architecture supports 10K+ jurisdictions.
Real-time vs. Batch Processing
Campaign finance data updates daily (NetFile/CalAccess). Real-time only for user-generated content (feed, Fora). Reduces infrastructure cost 80%.
Compliance Engine: Hardcoded vs. Rules Engine
Current CA Levine Act logic is hardcoded (simple, fast). At multi-state, extract to configurable rules: threshold amounts, lookback periods, entity types per state law.