Skip to content

SurrealDB Feasibility PoC - Quick Evaluation #460

Closed

Description

@malibio

SurrealDB Feasibility PoC - Quick Evaluation

Overview

Conduct a focused 2-week feasibility study of SurrealDB as a potential Turso replacement, following lessons learned from Epic #451 (LanceDB evaluation). This PoC tests ONLY desktop embedding to validate critical requirements before committing to full migration evaluation.

Context from Previous Evaluation

Epic #451 (LanceDB) Results:

  • 4 phases, 5 approaches tested, all failed
  • Key lesson: Test critical requirements FIRST (dynamic schema, embedding, mobile)
  • Recommendation: Stay with Turso
  • Decision: Validated that exhaustive evaluation prevents costly mistakes

Senior Architect Review (SurrealDB):

  • ✅ Dynamic schema works (SCHEMALESS validated)
  • ❌ Mobile NOT production-ready (SurrealKV explicit warning)
  • ❌ API instability (v2.0 breaking changes)
  • ⚠️ Performance concerns (pagination, complex queries documented)
  • ⚠️ Binary size: 16.1MB vs Turso's 1.9MB (8.5x larger)
  • Recommendation: Stay with Turso (90% confidence)
  • Alternative: Quick feasibility PoC if user insists

Scope: Desktop-Only Feasibility

What We're Testing:

  • ✅ Desktop embedding in Tauri (binary size, startup time)
  • ✅ SCHEMALESS dynamic schema validation
  • ✅ Query performance at scale (100K nodes)
  • ✅ Pagination performance (documented concern)
  • ✅ Complex query performance (filters, nested properties)

What We're NOT Testing:

  • ❌ Mobile embedding (SurrealKV not production-ready - known blocker)
  • ❌ Real-time sync (custom implementation required - deferred)
  • ❌ Multi-node deployment (not relevant for desktop-first)
  • ❌ RBAC (Tier 3 feature, not immediate priority)

Go/No-Go Criteria (STRICT)

Phase 1: Desktop Embedding (1 week)

GO Criteria:

  • ✅ Binary size <20MB (vs Turso's 1.9MB)
  • ✅ Startup time <500ms
  • ✅ SCHEMALESS queries work for arbitrary properties
  • ✅ Basic CRUD operations match Turso performance (within 2x)

NO-GO Triggers:

  • ❌ Binary size >20MB → STOP, recommend Turso
  • ❌ Startup time >1 second → STOP, recommend Turso
  • ❌ SCHEMALESS limitations discovered → STOP, recommend Turso

Phase 2: Dynamic Schema Stress Test (1 week)

GO Criteria:

  • ✅ Query 100K nodes with 1000+ unique properties efficiently
  • ✅ Pagination performance ≥50% of Turso baseline
  • ✅ Complex filters (multi-property, nested paths) ≤2x Turso latency
  • ✅ Index effectiveness on dynamic properties validated

NO-GO Triggers:

  • ❌ Pagination performance <50% of Turso → STOP, recommend Turso
  • ❌ Query degradation >2x on complex filters → STOP, recommend Turso
  • ❌ Memory usage >2x Turso for same dataset → STOP, recommend Turso

Implementation Approach

Phase 1: Desktop Embedding (Week 1)

Day 1-2: Integration

  • Add surrealdb crate to Cargo.toml
  • Create minimal embedded SurrealDB connection
  • Measure binary size impact (before/after)
  • Measure startup time (cold start, warm start)

Day 3-4: SCHEMALESS Validation

  • Create test table with SCHEMALESS mode
  • Insert 1000 nodes with arbitrary properties
  • Query using dot notation: properties.custom_field_123 = 'value'
  • Validate sparse field handling (nodes missing properties)

Day 5: Performance Baseline

Deliverable: Phase 1 report with GO/NO-GO recommendation

Phase 2: Dynamic Schema Stress Test (Week 2)

Day 1-2: Scale Testing

  • Insert 100K nodes with dynamic properties
  • Create 1000+ unique property names across nodes
  • Measure query performance across property combinations

Day 3-4: Pagination & Complex Queries

  • Test deep pagination (OFFSET 10000, LIMIT 100)
  • Test multi-property filters: status = 'done' AND priority > 3
  • Test nested property queries: customer.address.zip = '00042'
  • Measure query latency vs Turso baseline

Day 5: Analysis & Recommendation

  • Compile performance data
  • Document all GO/NO-GO criteria results
  • Final recommendation: Proceed to full evaluation OR Stay with Turso

Deliverable: Phase 2 report with final recommendation

Risk Mitigation

Lessons from Epic #451 Applied:

  1. ✅ Test critical requirements FIRST (dynamic schema, embedding)
  2. ✅ Strict GO/NO-GO criteria at each phase
  3. ✅ Desktop-only scope (mobile is known blocker)
  4. ✅ Performance benchmarks vs Turso baseline
  5. ✅ Time-boxed (2 weeks max, not 5-7 months)

Known Risks Accepted:

  • Mobile not tested (SurrealKV not ready - documented blocker)
  • Sync not tested (custom implementation required - deferred)
  • Production stability not tested (v2.0 breaking changes - deferred)

Risk Score: 60/100 (Medium-High)

  • Probability of hitting NO-GO: 60% (pagination, binary size, performance)
  • Cost if failed: 2 weeks (vs 5-7 months full migration)

Acceptance Criteria

Phase 1 Complete:

  • SurrealDB embedded in Tauri desktop app
  • Binary size measured and documented
  • Startup time benchmarked
  • SCHEMALESS queries validated with arbitrary properties
  • Basic CRUD performance vs Turso baseline documented
  • GO/NO-GO decision made

Phase 2 Complete (If Phase 1 = GO):

  • 100K nodes with 1000+ properties ingested
  • Pagination performance at scale benchmarked
  • Complex query performance documented
  • Memory usage profiled
  • All GO/NO-GO criteria evaluated
  • Final recommendation delivered

PoC Complete:

  • Feasibility report with data-driven recommendation
  • If GO: Plan for full evaluation (Epic scope)
  • If NO-GO: Close evaluation, return to Turso
  • Zero disruption to production Turso implementation

Success Metrics

Definition of Success:

  • All GO criteria met in both phases
  • Performance within 2x of Turso on critical operations
  • Clear path to mobile support identified (even if not tested)
  • Confidence level ≥80% for proceeding to full evaluation

Definition of Failure:

  • Any NO-GO trigger hit in Phase 1 or 2
  • Performance degradation >2x Turso on critical paths
  • Undocumented limitations discovered
  • Mobile path remains unclear/blocked

Resources & References

Architecture Documents:

SurrealDB Documentation:

Comparison Baselines:

Timeline

Week 1: Phase 1 (Desktop Embedding)

  • Days 1-2: Integration & binary size measurement
  • Days 3-4: SCHEMALESS validation
  • Day 5: Performance baseline & GO/NO-GO decision

Week 2: Phase 2 (Dynamic Schema Stress Test) - IF Phase 1 = GO

  • Days 1-2: Scale testing (100K nodes)
  • Days 3-4: Pagination & complex queries
  • Day 5: Analysis & final recommendation

Total Duration: 2 weeks (10 working days)

Definition of Done

  • Both phases completed with documented results
  • All GO/NO-GO criteria evaluated
  • Performance comparison data collected
  • Final recommendation delivered with confidence level
  • If GO: Epic created for full evaluation
  • If NO-GO: Evaluation closed, return to feature development
  • Zero impact on production Turso implementation

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Activity

  1. self-assigned this
    on Nov 11, 2025
  2. malibio commented on Nov 11, 2025

    @malibio
    CollaboratorAuthor

    SurrealDB PoC Complete - All GO Criteria Exceeded ✅

    Phase 1 Results (Desktop Embedding):

    • ✅ Startup: 52ms (90% under threshold)
    • ✅ Binary: 10MB (50% under threshold)
    • ✅ SCHEMALESS: 100% working
    • ✅ Queries: Clean dot notation

    Phase 2 Results (Scale & Performance):

    • ✅ 100K nodes: 104ms query (90% under threshold)
    • ✅ Pagination: 8.3ms (exceptional, no degradation)
    • ✅ Complex queries: 211ms avg (within bounds)

    Senior Architect Review:

    • Changed recommendation from 90% Stay → 85% Proceed
    • Validated all PoC findings as credible
    • Invalidated pagination concerns
    • Provided complete 6-week migration plan

    Migration Epic Created: #461

    Complete findings: See docs/architecture/data/surrealdb-feasibility-report.md

    Branch: feature/issue-460-surrealdb-poc
    Commit: 05a19e8

  3. added 2 commits that reference this issue on Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions