Repository navigation
LanceDB Parallel Implementation for Database Evaluation #451
Copy link
Copy link
Closed
Description
LanceDB Parallel Implementation for Database Evaluation
Overview
Implement LanceDB database operations in parallel with existing Turso implementation to validate feasibility of migration. This evaluation focuses on critical capabilities: automatic versioning, JSON scalar indexes for dynamic schema support, and atomic batch operations. The parallel approach enables risk-free validation while maintaining production stability.
Self-Contained Scope
- Parallel LanceDB implementation alongside existing Turso (zero disruption)
- Experimental Tauri command endpoints with
_lance_experimentalsuffix - JSON scalar index validation (Option B3 from architecture analysis)
- Feature flag controlled:
EXPERIMENTAL_USE_LANCEDBenvironment variable - Comprehensive evaluation framework with side-by-side comparison
- Data-driven recommendation based on real testing
Implementation Approach
Phase 1: Foundation
- Integrate existing LanceDB PoC (
nodespace-data-store) into desktop app - Implement parallel CRUD operations with experimental endpoints
- Backend batch coordinator for atomic operations
Phase 2: JSON Index Validation
- Validate JSON scalar index creation and performance
- Test multi-level nested property filtering (
address.street.zip) - Test filtered/partial indexes scoped to node types
- Document sparse property behavior
Phase 3: Evaluation
- Performance benchmarking framework (LanceDB vs Turso comparison)
- Feature parity validation (all Turso operations work in LanceDB)
- Developer testing UI for side-by-side exploration
Phase 4: Decision
- Compile evaluation report with performance data
- Migration recommendation with risk assessment
- Path forward (commit to LanceDB or optimize Turso)
Sub-Issues
- Integrate LanceDB PoC alongside Turso #452
- Implement parallel CRUD with experimental endpoints #453
- Validate JSON scalar index creation and querying #454
- Test filtered and partial index support #455
- Create performance benchmark framework #456
- Validate feature parity with Turso #457
- Create developer testing UI #458
- Compile evaluation report and recommendation #459
Acceptance Criteria
- LanceDB PoC integrated and running alongside Turso
- All CRUD operations work via experimental endpoints
- JSON scalar indexes validated with real data
- Performance benchmarks completed
- Feature parity confirmed
- Developer testing UI functional
- Evaluation report delivered with clear recommendation
- Zero disruption to existing Turso implementation
Technical Implementation Notes
Architecture Decision Context:
- Primary requirement: Automatic versioning/time-travel (LanceDB provides built-in)
- Critical need: Dynamic schema support (users add properties at runtime)
- Key validation: JSON scalar indexes (GitHub issue #4516, PRs #4566, #4577)
- Risk mitigation: Parallel implementation enables data-driven decision
Key Technologies:
- LanceDB (columnar vector database with automatic versioning)
- Apache Arrow (columnar in-memory format)
- JSON scalar indexes (late 2024 feature for nested property filtering)
- Backend batch coordinator (atomic operations creating single version)
Feature Flag Design:
pub struct NodeService {
turso_db: Arc<TursoConnection>,
lance_db: Option<Arc<LanceDataStore>>,
use_lancedb: bool, // EXPERIMENTAL_USE_LANCEDB env var
}Experimental Endpoint Pattern:
#[tauri::command]
async fn create_node_lance_experimental(node: Node) -> Result<String>;
#[tauri::command]
async fn compare_backends(operation: String, data: Value) -> Result<ComparisonResult>;Resources & References
Architecture Documents:
/Users/malibio/Desktop/nodespace-lancedb-vs-tursodb.md- Original decision rationale/Users/malibio/Downloads/nodespace-persistence-architecture.md- Atomicity analysis/Users/malibio/nodespace/nodespace-data-store/- Existing LanceDB PoC
LanceDB Features:
- JSON scalar indexes: GitHub issue #4516, PRs #4566, #4577
- Native JSON type with
json_extract()support - Automatic versioning via append-only architecture
NodeSpace Patterns:
docs/architecture/development/process/epic-and-subissue-workflow.md- Single epic branch:
feature/issue-451-lancedb-evaluation - All sub-issues work on same branch
Definition of Done
- All 8 sub-issues completed and closed
- LanceDB capabilities validated with real data
- Performance comparison data collected
- Clear recommendation delivered (migrate or optimize Turso)
- If recommending migration: migration plan documented
- If recommending Turso: optimization strategy documented
- Zero regressions in existing Turso implementation
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Reactions are currently unavailable
Activity
malibio commentedon Nov 10, 2025
Test Baseline (2025-11-10)
✅ All tests passing: 769 passed, 31 skipped
Test execution time: ~9 seconds (in-memory mode)
No test failures to track. Starting implementation with clean baseline.
WIP: LanceDB integration and parallel CRUD operations complete (#452, #…
malibio commentedon Nov 10, 2025
Progress Update - Phase 1 Complete ✅
Completed Sub-Issues:
Key Achievements:
Dependency Resolution
halfversion conflict (now compatible with Rust 1.91.0)Integration Architecture
EXPERIMENTAL_USE_LANCEDBenvironment variableExperimental Commands
create_node_lance_experimentalread_node_lance_experimentalupdate_node_lance_experimentaldelete_node_lance_experimentalcompare_backends- Primary validation tool for side-by-side comparisonTest Status
Architecture Highlights:
Next Phase:
Ready to proceed with JSON scalar index validation (#454) and benchmark framework (#455).
Commit: a59ab16
WIP: JSON scalar index validation and performance benchmarking comple…
malibio commentedon Nov 10, 2025
[Phase 2 Retest] LanceDB v0.22.3 Evaluation - CRITICAL FINDINGS
Upgraded from v0.20 → v0.22.3 to test if JSON querying capabilities improved.
Result: ❌ JSON Querying BROKEN - Situation WORSE than v0.20
Critical Discovery
LanceDB v0.22.3 has BROKEN the
json_extract()functionality that worked in v0.20:Phase 2 (v0.20) Status:
json_extract(properties, '$.field')worked with Utf8 string storagev0.22.3 Regression:
json_extract()signature changed: requires LargeBinary (JSONB format)Technical Details
JSONB Format Requirement:
LanceDB v0.22.3 expects JSONB binary format (like PostgreSQL), not UTF-8 JSON strings.
Error Encountered:
Migration Attempt:
DataType::Utf8→DataType::LargeBinaryStringArray→LargeBinaryArrayTo Support v0.22.3 Would Require:
Test Results
All v0.22.3 tests FAILED:
Updated Recommendation
🔴 STRONGLY DO NOT MIGRATE to LanceDB v0.22.3
Phase 2 "DO NOT MIGRATE" recommendation now STRENGTHENED:
Key Takeaways
Turso Advantages (Reinforced)
Files Modified
Cargo.toml: lancedb 0.22.3, arrow 56.0src/datastore/lance/store.rs: Schema migration attempt (incomplete)src/datastore/lance/tests/json_index_tests.rs: Syntax updatessrc/datastore/lance/tests/json_index_v22_retest.rs: New test suitedocs/json_scalar_index_validation_v0.22.md: Comprehensive findings reportCommit: 8034a9d
Next Steps
Main agent should proceed with final evaluation report (#459) using these strengthened findings. The Phase 2 blocker not only persists but has worsened in v0.22.3.
CRITICAL: LanceDB v0.22.3 JSON querying fundamentally broken