Want to save your progress?
Create a free account to track your lessons and quizzes across devices.
Register Login
Create a free account to track your lessons and quizzes across devices.
Register Login
« Back to ClassCompleted: 50%
The Serverless Option - SQLite
Page 2 of 2
Administering SQLite: WAL Mode and VACUUM
While SQLite requires little setup, a DBA (or the developer acting as one) must know how to maintain performance.
-
Write-Ahead Logging (WAL): By default, SQLite uses a rollback journal for atomic commits. However, enabling WAL mode significantly improves concurrency, allowing readers to not block writers and vice versa. This is crucial for applications with higher activity.
- Command:
PRAGMA journal_mode=WAL;
- Command:
-
The VACUUM Command: When you delete data from an SQLite database, the file size does not automatically shrink. Instead, the space is marked as "free" for future data. To actually reclaim that disk space and defragment the database file, you must run the VACUUM command.
- Command:
VACUUM;
- Command: