| Feature | SQLite | MySQL Server |
|---|---|---|
| Architecture | Embedded (no server) | Client-server |
| Setup | No installation needed | Requires installation & configuration |
| Storage | Single .db file | Managed database directories |
| Concurrency | Limited (best for low write load) | High concurrency support |
| Scalability | Small to medium apps | Medium to very large systems |
| User Management | None (file-based access) | Full user & role system |
| Performance | Very fast for local/single-user | Optimized for multi-user workloads |
| Backup | Copy the file | Dump tools / replication / snapshots |
What is SQLite?
SQLite is a lightweight, embedded relational database engine.
Key characteristics:
-
📦 Serverless — no separate database server process
-
📁 File-based — entire database is stored in a single file
-
⚡ Zero configuration
-
🔌 Runs inside your application (linked as a library)
Commonly used in:
-
Mobile apps (Android, iOS)
-
Desktop apps
-
Browsers (e.g., local storage engines)
-
Small tools and embedded systems
What is MySQL Server?
MySQL is a full client-server relational database management system (RDBMS).
Key characteristics:
-
🖥 Runs as a separate database server process
-
🌐 Supports multiple concurrent users
-
🔐 Advanced security & user management
-
📊 Designed for web apps and production systems
Commonly used in:
-
Web applications
-
Enterprise systems
-
APIs & backend services
-
Cloud-hosted platforms
A mobile Angular + Capacitor app → SQLite
-
A Node.js backend serving 10,000 users → MySQL Server
SQLite has a built-in .dump command.
Using CLI:
sqlite3 mydatabase.db .dump > dump.sql
This generates a file containing:
-
CREATE TABLE statements
-
INSERT statements
-
Indexes
-
Triggers
Restore from dump:
sqlite3 newdatabase.db < dump.sql
🔹 2️⃣ Simple Backup (Copy the File)
Because SQLite is just a single file:
cp mydatabase.db backup.db
⚠️ Important:
If the database is being written to, use the .backup command instead:
sqlite3 mydatabase.db ".backup backup.db"🔹 2️⃣ Read Performance
SQLite is very fast for reads.
It can handle:
Thousands of SELECT queries per second
Many concurrent readers
Great performance for cached data
Reads do NOT block other reads.
🔹 3️⃣ Write Concurrency (Important Limitation)
SQLite allows:
🚨 Only ONE writer at a time.
That means:
Multiple users can read simultaneously
But writes are serialized (queued)
If many users try to write at the same time:
You’ll see
database is lockederrorsPerformance drops under heavy write load
Rough Practical Numbers
These are approximate real-world observations:
Workload Type What SQLite Can Handle Reads 10,000+ per second (depending on hardware) Writes 100–1,000 small writes/sec (serialized) Concurrent Users Dozens fine, hundreds depends on workload Database Size Multi-GB very common MySQL support concurrent writes?
Yes — especially when using the default engine InnoDB (the default in modern MySQL).
It supports:
Multiple concurrent writers
Row-level locking
Transactions (ACID compliant)
MVCC (Multi-Version Concurrency Control)
This is very different from SQLite, which allows only one writer at a time.