You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/backends/sqlite/README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,10 +75,38 @@ backend: {
75
75
-**Zero Configuration** - No database server setup required, just specify a file path
76
76
-**File-Based Storage** - Self-contained database in a single file for easy deployment
77
77
-**ACID Transactions** - Full transaction support for data integrity and safe job claiming
78
+
-**WAL Mode** - Write-Ahead Logging enabled by default for better concurrent access
78
79
-**Lightweight** - Minimal resource footprint, perfect for development and small deployments
79
80
-**Migration Support** - Automatic database schema management with Knex.js migrations
80
81
-**Portable** - Database files can be easily backed up, moved, or shared
81
82
83
+
## WAL Mode and Concurrency
84
+
85
+
The SQLite backend automatically enables **WAL (Write-Ahead Logging) mode** for improved concurrent access. This provides several benefits:
86
+
87
+
-**Better Concurrency**: Allows multiple readers and one writer simultaneously
88
+
-**Reduced Lock Contention**: Minimizes `SQLITE_BUSY` errors during concurrent job processing
89
+
-**Improved Performance**: Faster writes and better throughput for job queue operations
90
+
-**Safer Transactions**: More reliable atomic operations for job claiming
91
+
92
+
### WAL Mode Files
93
+
94
+
When WAL mode is enabled, SQLite creates additional files alongside your main database:
95
+
96
+
-`sidequest.sqlite` - Main database file
97
+
-`sidequest.sqlite-wal` - Write-ahead log file
98
+
-`sidequest.sqlite-shm` - Shared memory index file
99
+
100
+
These files are managed automatically by SQLite and should not be manually edited or deleted.
101
+
102
+
### Limitations
103
+
104
+
While WAL mode significantly improves concurrency, SQLite is still not recommended for high-concurrency production deployments. For production use with multiple workers or distributed systems, consider using:
105
+
106
+
-**PostgreSQL** (`@sidequest/postgres-backend`) - Best for production
107
+
-**MySQL** (`@sidequest/mysql-backend`) - Good for production
108
+
-**MongoDB** (`@sidequest/mongo-backend`) - Alternative for production
0 commit comments