Architecture Decision Records (ADRs)
Review formal engineering decision records, evaluated technical alternatives, pros/cons matrices, and measured consequences from production systems.
Architecture Decision Records (ADRs)
Formal records of technical trade-offs, evaluated alternatives, and production outcomes
ADR 001: Unifying Geospatial & Vector Search in PostgreSQL + PostGIS + pgvector
1. Context & Engineering Problem
GeoFusion AI requires both high-precision geospatial bounding queries (PostGIS ST_Intersects, ST_DWithin) and high-dimensional semantic vector search over geological text embeddings (768-dim GeoBERT embeddings). We evaluated maintaining a separate dedicated vector database (Pinecone/Milvus) versus unifying within our existing PostgreSQL cluster via pgvector.
2. Architectural Decision Outcome
We decided to adopt PostgreSQL with PostGIS and pgvector (using HNSW indexing). This eliminated dual-write synchronization drift, preserved strict ACID transactional boundaries during bulk survey imports, and cut infrastructure operational cost by 60%.
3. Evaluated Alternatives & Trade-Offs
- Specialized vector clustering
- Managed scaling out of the box
- Cross-system dual write sync latency
- No native PostGIS spatial join capabilities
- Higher operational cost
- Single database cluster for spatial & vector queries
- Full ACID transactional safety
- Zero data pipeline sync drift
- Requires proper memory tuning for HNSW index graphs