SQLite is a self-contained, serverless SQL database engine that stores an entire database in a single file. It runs inside the application process, so there is nothing to install or administer separately.
Why it matters
SQLite is probably the most widely deployed database in the world, found in phones, browsers, and desktop software. It is excellent for local storage, prototypes, tests, and small to medium websites with modest write concurrency. It is ACID-compliant, but only one writer can work at a time, so it is a poor fit for write-heavy multi-user servers.
Example
sqlite3 app.db
CREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT);
INSERT INTO notes (body) VALUES ('hello');
SELECT * FROM notes;
Copying app.db copies the whole database.
Common mistakes
- Putting the database file on a network share, where file locking is unreliable.
- Copying the file while a write is in progress, producing a corrupt backup. Use the backup command or write-ahead log checkpoint.
- Expecting it to handle many simultaneous writers like a client-server database.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.