What is a database?
A database is a place where an app keeps its information in an organised way, such as users, posts and orders. SQLite and MySQL are both databases, and both use the SQL language to ask questions. They work in very different ways.
What is SQLite?
SQLite keeps the whole database in one file on disk. There is no separate server program to run. The app opens the file and reads it directly. It is like keeping your notes in one notebook that sits on your desk.
It is small, fast to set up and needs no setup of users or passwords. Phones, browsers and many small apps use it.
What is MySQL?
MySQL is a database server. It runs as its own program and waits for requests. Many apps and many users can connect to it at the same time, even from other computers. It is like a library with a librarian who serves many visitors.
WordPress and many large websites use MySQL.
Main differences
| Point | SQLite | MySQL |
|---|---|---|
| How it runs | A file, no server | A separate server program |
| Setup | Almost none | Needs install and users |
| Many users at once | Limited, especially for writing | Handles many at once |
| User accounts and security | None built in | Users and privileges |
| Network access | Same machine only | Over the network |
| Size | Best for small to medium data | Handles very large data |
| Backup | Copy the file | Export or use backup tools |
When to choose SQLite
- Small apps, tests and learning projects.
- Mobile or desktop apps that keep local data.
- Sites with few visitors and very little writing.
When to choose MySQL
- Busy websites with many visitors.
- Apps that need several users writing at the same time.
- Projects that need user permissions or run on more than one server.
- Software such as WordPress that requires it.
How to decide
- Check what your app supports. Some apps work with only one.
- Think about how many people use it at once.
- Think about how much data you expect to have.
- If you are unsure on a hosting plan, choose MySQL. It is the common choice on web hosting.
Quick recap
- SQLite is a single file with no server. It is simple and light.
- MySQL is a full server for many users and large data.
- SQLite suits small apps; MySQL suits busy websites.
- Pick what your app supports and what your traffic needs.