Architecture Overview
Understand how Isofold processes and optimizes your queries.
How Isofold Works
Isofold is a drop-in SQL proxy that optimizes queries before they reach your data warehouse. It’s designed to be transparent, verifiable, and performant.
At a high level:
Isofold rewrites queries in-flight and ensures that results remain unchanged. It supports dry-run pricing, query diffing, and output equivalence verification.
Core Components
1. Proxy Layer
The proxy receives SQL queries over HTTP, JDBC, or native Postgres wire protocol. It handles:
- Protocol translation (if needed)
- Authentication passthrough
- Routing to the appropriate backend engine
2. Rewrite Engine
The rewrite engine is responsible for transforming SQL into semantically equivalent forms that are cheaper to execute.
It performs optimizations such as:
- Projection pruning
- Join simplification
- Subquery flattening
- Predicate pushdown
You can configure aggressiveness levels per warehouse or per team.
3. Cost Model
For supported warehouses like BigQuery, Isofold runs a dry-run of both the original and optimized queries to compare estimated costs.
4. Verification Engine (Optional)
When enabled, Isofold will:
- Execute both the original and rewritten queries
- Compare result sets for equality
- Log any divergence or mismatch for audit purposes
Example Rewrite
Original query:
Rewritten query:
Assuming only those columns are ever referenced, the rewrite saves scan costs.
Deployment Options
Isofold can be:
- Used as a hosted service with team-specific proxy URLs
- Deployed inside your cloud/VPC
- Run at the edge via Fly.io
See Cloud Setup or Self-Hosted Setup to choose what works best for you.
Next: Dive deeper into the Rewrite Engine.