Design WAL Routing with Efficient Indexing #3341
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a high-performance WAL→shape routing system designed to achieve 10-20 μs/lookup latency and ~12-13 bytes/key memory usage through a novel four-layer architecture.
Architecture
Four-layer funnel design optimized for "mostly no match" workloads:
Presence Filter (Binary Fuse): Ultra-fast negative path (~0.3-0.5 μs)
Exact Membership (MPHF + Shape-ID Pool): Compact exact lookup
Predicate Gate (Bytecode VM): Compiled WHERE clause evaluation
Write Path: Returns matched shape IDs for log appending
Implementation
Rust NIF (native/shape_router/):
Elixir Interface:
Benchmarks:
Performance Targets (Projected)
Documentation
Status
Prototype complete and validated. Ready for team discussion. Not production-ready yet - see roadmap in findings document.
Next Steps
🤖 Generated with Claude Code