VSKI v0.6.5
Features
Section titled “Features”Workflow Execution on Replicas
Section titled “Workflow Execution on Replicas”Replicas can now execute workflows locally using their own workflows.db database. Since workflows.db and stats.db are excluded from replication, each replica maintains independent workflow state while still having access to synced user data from default.db.
This enables:
- Distributed workflow processing - Workers can run on any replica
- Load distribution - Offload workflow execution from master
- Local stats collection - Each replica tracks its own statistics
Configuration
Section titled “Configuration”No additional configuration required. Workflows automatically work on replicas when:
- Replica has its own
workflows.db(created automatically) - Workflow endpoints are excluded from read-only middleware
# Replica configurationREPLICA_MODE=replicaMASTER_URL=https://master.example.comSYNC_INTERVAL=60
# Workflows run locally on replica# Workers connect to replica's /api/workflow/ws endpointFile Replication for Replicas
Section titled “File Replication for Replicas”When using local storage (not S3), replicas can now automatically sync uploaded files from the master server. This ensures file attachments are available on replica servers alongside the database data.
How It Works
Section titled “How It Works”- File Journal: Master server tracks file operations (add/delete) in a
_file_journaltable - Automatic Sync: After each database sync, replicas fetch and apply file changes
- Dual Cleanup Strategy:
- Ack-based: Journal entries are removed after replicas confirm sync
- Time-based: Entries older than the retention period are automatically cleaned up
Configuration
Section titled “Configuration”# Master server - file journal is created automatically when:# - Not in replica mode# - Not using S3 storageFILE_SYNC_RETENTION_DAYS=7 # Default: 7 days
# Replica server - file sync is enabled automatically when:# - REPLICA_MODE=replica# - Not using S3 storageREPLICA_MODE=replicaMASTER_URL=https://master.example.comSYNC_INTERVAL=60New Replica Endpoints
Section titled “New Replica Endpoints”| Endpoint | Description |
|---|---|
GET /api/replica/files?since=<id> | List file journal entries since the given ID |
GET /api/replica/file/*path | Download a file from the master server |
POST /api/replica/files/ack | Acknowledge synced files (triggers cleanup) |
Technical Details
Section titled “Technical Details”- File journal is stored in
default.dband replicates with the database - Sync happens immediately after each database sync cycle
- Files are verified with SHA256 checksum during transfer
- Journal cleanup runs every 24 hours on the master
New Environment Variables
Section titled “New Environment Variables”| Variable | Default | Description |
|---|---|---|
FILE_SYNC_RETENTION_DAYS | 7 | Days to retain file journal entries (time-based cleanup) |
Technical Details
Section titled “Technical Details”Files Changed
Section titled “Files Changed”internal/config/config.go- AddedFileSyncRetentionDaysconfig optioninternal/db/db.go- Added_file_journaltable and indexinternal/replica/file_journal.go- New file journal service with cleanup schedulerinternal/replica/syncer.go- Added file sync methodsinternal/replica/types.go- Added file sync request/response typesinternal/api/replica.go- Added file sync endpointsinternal/services/storage.go- Added journal recording for file operationsinternal/api/records.go- Record deletion now triggers file cleanupinternal/app/bootstrap.go- Wired up file journal and cleanup scheduler
Breaking Changes
Section titled “Breaking Changes”None. File replication is automatic when using local storage in replica mode. S3 storage continues to handle file replication independently.
Migration
Section titled “Migration”No migration required. The _file_journal table is created automatically on startup for master servers using local storage.