The Reality of Alpha Database Testing
I've been debugging Turso since they dropped the alpha announcement, and honestly? It's like testing someone's weekend project that accidentally became a startup. Here's what actually works with a database that changes every damn day.
Version Reality Check: Whatever's on their GitHub releases page changes daily. The MVCC stuff is experimental - and by experimental, I mean "guaranteed to corrupt your test data."
Survival Testing Strategy
Start with File Compatibility: Your SQLite files might work. I tried importing a 2GB database from prod and basic stuff worked, but foreign keys were fucked. Always run this first:
PRAGMA foreign_keys=OFF;
PRAGMA integrity_check;
Test One Thing at a Time: Don't be like me and test everything at once. Issue #3065 ate three days because I was testing concurrent writes AND schema changes. Test separately:
- Basic CRUD operations (works fine)
- Indexes (work until they don't)
- MVCC transactions (don't bother)
- Vector search (worked when I tested it)
- WebAssembly (somehow works better than native)
Connection Management is a Nightmare
Connection handling is where this thing really shines - and by shines, I mean explodes in creative ways. SQLite connections are boring and predictable. Turso connections fail at random times for mysterious reasons.
Connection Retry Pattern That Actually Works:
async fn connect_with_retry(path: &str, max_attempts: u32) -> Result<Connection> {
let mut attempts = 0;
loop {
match turso::connect(path).await {
Ok(conn) => return Ok(conn),
Err(e) if attempts < max_attempts => {
attempts += 1;
tokio::time::sleep(Duration::from_millis(100 * attempts as u64)).await;
}
Err(e) => return Err(e),
}
}
}
Why This Matters: The JavaScript bindings crash if you look at them wrong and the Go driver has sync issues. Connection pooling saves your sanity.
MVCC Testing (Don't Bother Yet)
The whole point is concurrent writes, but it's broken. I tried 10 concurrent connections and hit every bug imaginable:
- Multi-threaded deadlocks: Transactions just hang forever
- Permanent locks after rollback: Database stays locked even after ROLLBACK - genius
- DELETE operations don't work: Rows stick around like unwanted guests
Real Talk: Skip MVCC unless you're testing it specifically. Use WAL mode like a normal person:
PRAGMA journal_mode=WAL; -- Not PRAGMA journal_mode=MVCC
Performance Testing (When It Works)
The async I/O improvements are legit. I hammered a test app with 1000 SELECT statements:
- SQLite: Everything blocked for a few seconds
- Turso: Handled it fine, sub-50ms responses
But performance is random as hell. Simple SELECTs fly, complex JOINs sometimes crawl slower than SQLite for no apparent reason.
Don't Assume Anything: I wasted two weeks optimizing queries that were already fast, while ignoring actual bottlenecks in schema operations. Test everything - what worked fine in v0.1.3 crashed in v0.1.4, and now in v0.1.5 it just returns wrong data.
Data Integrity (It Will Get Corrupted)
Alpha databases eat data. This isn't paranoia, it's guaranteed.
Backup Everything, All the Time:
## Before any testing session
cp production.db backup-$(date +%Y%m%d-%H%M%S).db
## After any schema changes
turso-cli .dump | gzip > backup-schema-$(date +%Y%m%d).sql.gz
Check Integrity Obsessively: Run PRAGMA integrity_check
after anything risky. I've caught database corruption three times this way before it spread and fucked everything.
The 3AM Debugging Toolkit
When shit breaks at 3AM (and it will), here's your diagnostic toolkit:
1. Connection State Check:
lsof -p $(pgrep turso) | grep db # See open file handles
2. WAL File Inspection:
file database.db-wal # Should show SQLite WAL file
wc -c database.db-wal # WAL size - over 100MB means checkpoint issues
3. Process Memory Check:
ps aux | grep turso # Memory usage - over 2GB means memory leaks
4. Error Log Parsing:
grep -E "(panic|SIGABRT|corruption)" /var/log/turso.log
Timeline Reality (It Takes Forever)
Plan for this taking forever. I scheduled two weeks for testing and it took six fucking weeks. Alpha software breaks in ways that violate the laws of physics.
Week 1-2: Basic stuff works, you think you're smart
Week 3-4: Weird crashes appear, you question your sanity
Week 5-6: Deep debugging hell, filing GitHub issues, considering other careers
The Discord community is actually decent for debugging. Maintainers respond fast if you include crash logs and don't just say "it doesn't work."