Migration Guide: v3.0.0 to v3.1.0
Published: 2025-12-08 Target Audience: Developers, System Administrators, DevOps Engineers
Table of Contents
- Overview
- What’s New in v3.1.0
- Breaking Changes
- New Features Overview
- CLI Flag Changes
- Code Migration Examples
- Single-User to Multi-User Transition
- Backward Compatibility Notes
- Troubleshooting Migration Issues
- FAQ
Overview
HeliosDB-Lite v3.1.0 adds multi-user ACID transaction support for in-memory mode with user-triggered persistence. The release is backward compatible with v3.0.0 and adds capabilities for multi-user applications.
Migration Complexity: Low Estimated Migration Time: 30 minutes - 2 hours Breaking Changes: None Recommended Upgrade Path: Direct upgrade from v3.0.0
What’s New in v3.1.0
Major Features
-
Multi-User Session Management
- Concurrent user sessions with independent transaction contexts
- Per-user resource quotas and connection limits
- Session timeout and cleanup mechanisms
- Full PostgreSQL-compatible session management
-
Enhanced Locking and Concurrency
- Advanced lock manager with deadlock detection
- Three lock modes: Shared, Exclusive, Update
- Configurable lock timeouts
- Wait-for graph based deadlock resolution
-
Configurable Isolation Levels
- READ COMMITTED (default)
- REPEATABLE READ
- SERIALIZABLE with conflict detection
-
User-Triggered Persistence
- Manual dump/restore commands
- Incremental dump support (append mode)
- Automated backup scheduling
- Dirty state tracking
-
Resource Management
- Per-user memory quotas
- Transaction and query timeouts
- System-wide resource limits
- Connection pooling support
Enhancements
- Improved CLI with new
dumpandrestorecommands - Enhanced configuration with 4 new sections
- Dirty state warnings on shutdown
- API documentation
- Performance optimizations for high-concurrency workloads
Breaking Changes
None. HeliosDB-Lite v3.1.0 is backward compatible with v3.0.0.
Existing applications will continue to work without any code changes.
New Features Overview
1. Session Management
Before (v3.0.0): a single in-process instance with no session concept.
After (v3.1.0): each PostgreSQL wire connection runs in its own session with an independent transaction context, so concurrent clients no longer share one transaction:
-- Connection ABEGIN;INSERT INTO users VALUES (1, 'Alice');COMMIT;
-- Connection B, at the same time, in its own transactionBEGIN;SELECT count(*) FROM users;COMMIT;Migration Note: Sessions are created per connection. Existing clients work without changes.
2. Dump/Restore Commands
New CLI Commands:
# Dump in-memory database to fileheliosdb-lite dump --output backup.heliodump
# Restore from dump fileheliosdb-lite restore --input backup.heliodump
# Incremental backup (append mode)heliosdb-lite dump --output backup.heliodump --append3. Isolation Levels
Before (v3.0.0):
- Default MVCC snapshot isolation (similar to REPEATABLE READ)
After (v3.1.0):
-- Set isolation level per transactionBEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;-- orBEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;-- orBEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ;4. Resource Quotas
New Configuration:
[resource_quotas]memory_limit_per_user_mb = 1024max_concurrent_queries = 100query_timeout_secs = 60CLI Flag Changes
Start Command
New Flags (v3.1.0):
# Current releases refuse to start without a REST token-signing secretexport HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"
# Before (v3.0.0): --memory flag implied embedded modeheliosdb-lite start --memory --port 5432
# After (v3.1.0): Same command, now supports multi-user sessionsheliosdb-lite start --memory --port 5432
# New option: Explicitly require --data-dir for persistent modeheliosdb-lite start --data-dir /var/lib/heliosdb --port 5432Migration: No changes required. Existing commands work identically.
REPL Command
Before (v3.0.0):
heliosdb-lite repl --memoryAfter (v3.1.0):
# Same command, now with session supportheliosdb-lite repl --memory
# New: Execute single query and exitheliosdb-lite repl --memory --execute "SELECT * FROM users"Migration: No changes required.
New Commands
Dump Command
heliosdb-lite dump [OPTIONS]
Options: --output <PATH> Output file path (required) --compress <TYPE> Compression: none, lz4, zstd (default: zstd) --compression-level <N> Compression level (default: 3) --tables <TABLES> Comma-separated table list --append Incremental dump mode --verbose Verbose outputRestore Command
heliosdb-lite restore [OPTIONS]
Options: --input <PATH> Input file path (required) --mode <MODE> Restore mode: clean, append (default: clean) --tables <TABLES> Comma-separated table list --on-conflict <ACTION> Conflict resolution: error, skip, update --verbose Verbose outputhealth command
heliosdb-lite status [OPTIONS]
Options: --format <FORMAT> Output format: text, json (default: text)Code Migration Examples
Example 1: Basic Application (No Changes Required)
SQL that ran on v3.0.0 runs unchanged on v3.1.0, from the REPL or over the PostgreSQL wire:
CREATE TABLE users (id INT PRIMARY KEY, name TEXT);INSERT INTO users VALUES (1, 'Alice');SELECT * FROM users;Example 2: Adding a Scheduled Backup
# Daily dump at 02:000 2 * * * heliosdb-lite dump --output /backups/daily-$(date +\%Y\%m\%d).heliodumpExample 3: Isolation Level Configuration
-- Per sessionSET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-- Or per transactionBEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;Single-User to Multi-User Transition
Step 1: Assess Current Usage
Questions to ask:
- Do you have concurrent database access?
- Do you need per-user resource limits?
- Do you require different isolation levels for different operations?
- Do you need session-based auditing?
If NO to all: Continue using v3.1.0 as you used v3.0.0 If YES to any: Give each user its own PostgreSQL wire connection and role, and set the isolation level per session or per transaction
Step 2: Configure Limits (If Needed)
[resource_quotas]memory_limit_per_user_mb = 1024max_concurrent_queries = 100query_timeout_secs = 300Step 3: Keep Transactions in SQL
BEGIN;INSERT INTO users VALUES (1, 'Alice');COMMIT;Step 4: Add Backup Strategy
# Setup cron job for daily backups0 2 * * * heliosdb-lite dump --output /backups/daily-$(date +\%Y\%m\%d).heliodumpBackward Compatibility Notes
SQL Compatibility
All existing SQL commands work unchanged.
Configuration Compatibility
v3.0.0 config.toml works unchanged in v3.1.0
Optional new sections:
[session] # Optional[locks] # Optional[dump] # Optional[resource_quotas] # OptionalDatabase File Compatibility
- In-memory mode: No files, always compatible
- Persistent mode: RocksDB format unchanged
- Dump format: New
.heliodumpformat (v3.1.0+)
Wire Protocol Compatibility
- PostgreSQL wire protocol: Unchanged
- HTTP REST API: Unchanged
- All existing clients continue to work
Troubleshooting Migration Issues
Issue 1: “Session not found” Errors
Symptom:
Error: SessionNotFound(123)Cause: The connection’s session was closed or timed out
Solution: Open a new connection; each PostgreSQL wire connection creates its own session.
Issue 2: Lock Timeout Errors
Symptom:
Error: Lock timeout exceededCause: High lock contention with default 30-second timeout
Solution:
[locks]timeout_ms = 60000 # Increase to 60 secondsIssue 3: Serialization Failures
Symptom:
Error: SerializationFailure("Read-write conflict")Cause: Using SERIALIZABLE isolation with concurrent updates
Solution: Retry the whole transaction in the client when it fails with SQLSTATE 40001
(serialization failure), up to a small number of attempts.
Issue 4: Out of Memory
Symptom:
Error: memory limit exceeded for userCause: Per-user memory quota exceeded
Solution:
[resource_quotas]memory_limit_per_user_mb = 2048 # Increase to 2 GBIssue 5: Dump File Not Found
Symptom:
Error: No such file or directory: /backups/db.heliodumpCause: Dump directory doesn’t exist
Solution:
mkdir -p /backupsheliosdb-lite dump --output /backups/db.heliodumpFAQ
Q1: Do I need to change my code to upgrade to v3.1.0?
A: No. v3.1.0 is 100% backward compatible. Existing code works without changes.
Q2: Can I use v3.1.0 without session management?
A: Yes. Session management is optional. Use it only if you need multi-user features.
Q3: How do I migrate from v3.0.0 to v3.1.0?
A:
- Download v3.1.0 binary
- Replace v3.0.0 binary
- No code changes required
- Optionally adopt new features (sessions, dump/restore)
Q4: Are dump files from v3.1.0 compatible with future versions?
A: Yes. Dump format is version-stamped and designed for forward compatibility.
Q5: Can I downgrade from v3.1.0 to v3.0.0?
A: Yes, but:
- Dump files (
.heliodump) won’t work in v3.0.0 - Configuration sections
[session],[locks],[dump],[resource_quotas]will be ignored
Q6: Does v3.1.0 require more memory than v3.0.0?
A:
- Single-user mode: Same memory usage
- Multi-user mode: +2-4 KB per session, +32 bytes per lock
- Overall: Minimal increase (<5%) for typical workloads
Q7: How do I enable automated backups?
A:
[dump]schedule = "0 2 * * *" # Daily at 2 AMdump_dir = "/var/backups/heliosdb"Or via cron:
0 2 * * * heliosdb-lite dump --output /backups/daily.heliodumpQ8: Can I use v3.1.0 features with persistent mode?
A: Partial. Session management works in both modes. Dump/restore is primarily for in-memory mode (persistent mode already has WAL/RocksDB backups).
Q9: What isolation level should I use?
A:
- READ COMMITTED: Default, best for most web applications
- REPEATABLE READ: For reports requiring consistency
- SERIALIZABLE: For financial transactions requiring strict consistency
Q10: How do I test my migration?
A:
- Deploy v3.1.0 to staging environment
- Run existing test suite (should pass 100%)
- Test new features (dump/restore, sessions) if adopting
- Monitor for errors in logs
- Roll out to production gradually
Migration Checklist
- Review what’s new in v3.1.0
- Verify no breaking changes affect your application
- Download v3.1.0 binary or update dependency
- Test in development environment
- Update configuration (optional new sections)
- Adopt new features (sessions, dump/restore) if needed
- Update documentation and runbooks
- Setup automated backups (if using in-memory mode)
- Deploy to staging and verify
- Deploy to production
- Monitor for issues
Support
Issues: support@heliosdb.com Community: Discord Documentation: https://www.heliosdb.com/docs/lite/
Version: 3.1.0