Skip to content

ERP-Unlocked Data Backend - Executive Summary

Decision Required: Should we migrate ERP replica data from PostgreSQL to a lakehouse architecture?


ERP-Unlocked stores analytical data (2.3M products, 500K cross-references, 5M inventory records per org) in PostgreSQL, a database optimized for transactional workloads. This creates:

  • ❌ Performance issues - Full-text search on millions of rows is slow
  • ❌ No historical analytics - Can’t track pricing trends or inventory patterns
  • ❌ Expensive storage - PostgreSQL SSD storage costs $450/month for 4.5TB
  • ❌ Single-ERP limitation - Hard to query across Prophet21 + NetSuite simultaneously
  • ❌ AI friction - LLMs query raw SQL tables instead of semantic APIs

Migrate ERP data to a modern data backend:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ POSTGRES (OLTP) β”‚
β”‚ β€’ Orders, PDFs, Mappings β”‚
β”‚ β€’ Stays at 500 GB (90% reduction) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ HUDI LAKEHOUSE (OLAP) ← NEW β”‚
β”‚ β€’ Products, Customers, Inventory β”‚
β”‚ β€’ Cloudflare R2 storage ($40/month) β”‚
β”‚ β€’ Time-travel queries β”‚
β”‚ β€’ Partitioned by organization β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ CUBE SEMANTIC LAYER ← NEW β”‚
β”‚ β€’ GraphQL/REST API for AI agents β”‚
β”‚ β€’ Row-level security β”‚
β”‚ β€’ Pre-aggregated metrics β”‚
β”‚ β€’ Multi-ERP federation β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Benefit Impact
42% Cost Reduction $7,500/year savings ($1,500 β†’ $875/month)
Historical Analytics β€œShow pricing trend for product X over 6 months” βœ…
Multi-ERP Queries Search across Prophet21 + NetSuite simultaneously βœ…
AI-Ready Semantic layer with RLS for LLM tools βœ…
Better Performance 800ms β†’ 200ms for product search (4x faster)
Infinite Scale Postgres limited to ~5TB, Hudi scales to petabytes

REPLACED:

  • ❌ IERPSyncService (TypeScript) β†’ βœ… dlt pipelines (Python)
  • ❌ PostgreSQL erp_products, erp_customers tables β†’ βœ… Hudi lakehouse
  • ❌ Direct SQL queries β†’ βœ… Cube semantic layer API

STAYS THE SAME:

  • βœ… Trigger.dev orchestration (same scheduled tasks)
  • βœ… Clerk authentication
  • βœ… Astro + React frontend (no UI changes)
  • βœ… PostgreSQL for orders, documents, mappings
Timeline: 6 months (phased)
Phase 1 (Pilot): 6 weeks - Products only
Phase 2: 12 weeks - Full migration
Phase 3: 4 weeks - Cleanup
Resources:
β€’ 1 Data Engineer (full-time)
β€’ 1 Backend Engineer (50% time)
β€’ 1 DevOps Engineer (25% time)
Budget:
β€’ Engineering time: ~$60K
β€’ Infrastructure (pilot): ~$1,500
β€’ Ongoing: $875/month (42% lower than current)
Total Phase 1: $65K
Risk Mitigation
Performance worse than expected 6-week pilot validates before full commitment
Team unfamiliar with Hudi/Spark Hire experienced Data Engineer
Migration data loss Dual-run systems, checksums, rollback plan
Increased complexity Phased approach, comprehensive monitoring

βœ… PROCEED WITH PHASED APPROACH

Why:

  1. Strong technical fit for analytical workloads
  2. Enables AI-powered features impossible today
  3. 42% cost savings while improving performance
  4. Low-risk pilot phase validates architecture
  5. Future-proofs for multi-ERP, historical analytics

Conditions:

  • Commit to 6-month timeline (no rushing)
  • Hire/allocate 1 Data Engineer with Hudi expertise
  • Budget $65K for Phase 1
  • Define clear pilot success metrics

Option B: Incremental PostgreSQL Improvements

Changes: β€’ Add PostgreSQL read replica for OLAP queries
β€’ Implement TimescaleDB extension for time-series
β€’ Redis caching layer for product searches
Investment: ~$15K (3-4 weeks)
Savings: Minimal (~$100/month)
Benefits: Lower complexity, faster delivery
Drawbacks: No multi-ERP, no time-travel, scaling limits

Choose Data Backend IF:

  • βœ… Planning 5+ ERP integrations (NetSuite, SAP, Dynamics)
  • βœ… Need historical analytics (pricing trends, inventory patterns)
  • βœ… Scaling to 100+ organizations
  • βœ… Want AI-first semantic layer
  • βœ… Team can hire/train data engineers

Choose Incremental Improvements IF:

  • βœ… Current scale sufficient (<50 orgs)
  • βœ… Limited engineering resources
  • βœ… Risk-averse to architectural changes
  • βœ… Need faster time-to-value (<1 month)

  1. Week 1-2: Architecture review, stakeholder alignment
  2. Week 3-4: Hire Data Engineer, allocate resources
  3. Week 5-10: Phase 1 pilot (products only)
  4. Week 11: Decision gate (proceed or abort)

  • Full Technical Proposal - Complete 89-page architecture spec
  • Implementation Guide (repo history) - RBAC, Trigger.dev Python, monorepo organization, OpenTelemetry integration
  • Visual Comparison (repo history) - Side-by-side architecture diagrams

Questions? Contact the technical architecture team.