Decision Points: SQLite or PostgreSQL for a First Project?
"Which database should I use?" is one of the first questions learners ask. This illustrative walkthrough follows an invented learner, Learner E, through the decision for a first project, with what-if branches showing when the answer would change.
The project
Learner E wants to build a small habit tracker: log in, tick off daily habits, see a weekly summary. It will start on their laptop and might later go online for a few friends.
The two candidates
SQLite is a database library that stores everything in a single file. There is no server to install or run.
PostgreSQL is a database server. It runs as a separate program that apps connect to over a network.
Decision point 1: what do I need right now?
| Need | SQLite | PostgreSQL |
|---|---|---|
| Install and start in minutes | Yes, often built in | Needs installing and starting a server |
| Learn standard SQL | Yes | Yes |
| See the database as a single file I can copy | Yes | No |
| Many users writing at the same moment | Limited | Designed for it |
For learning on a laptop, SQLite wins on simplicity. Learner E starts with SQLite.
What-if branch A: the app goes online for a few friends
Many hosting platforms run apps on servers where local files may be temporary or not shared between copies of the app. In that case, a file-based database can lose data or not be visible to every copy. Learner E reads their host's documentation and finds it recommends a managed PostgreSQL database.
Outcome in this branch: switch to PostgreSQL before going online.
What-if branch B: the app stays on one machine
If the app runs on a single computer or a small server with a persistent disk, SQLite handles a few friends easily.
Outcome in this branch: stay with SQLite and keep backups of the file.
What-if branch C: the app is a phone or desktop app
SQLite is widely used inside mobile and desktop apps, because each user's data lives on their own device.
Outcome in this branch: SQLite is the natural choice.
Decision point 2: how hard is switching later?
Learner E worries about getting stuck. In practice:
- Basic SQL such as SELECT, INSERT, UPDATE, DELETE and JOIN is almost identical in both.
- Some details differ: data types, how auto-numbering ids are declared, and some date functions.
- An ORM or careful, simple SQL makes switching easier.
What Learner E does: keeps SQL simple, avoids engine-specific tricks, and writes table definitions in a single file so they are easy to adapt.
Decision point 3: what about MySQL?
MySQL is another popular server database. For a beginner project, it sits in the same place as PostgreSQL: a server, widely supported by hosts. Learner E picks PostgreSQL because their tutorial uses it, which is a perfectly good reason.
The decision record
| Stage | Choice | Reason |
|---|---|---|
| Learning on laptop | SQLite | No server, quick start |
| Going online on a platform with temporary disks | PostgreSQL | Host recommendation, shared access |
| Staying on one machine | SQLite | Simple and sufficient |
What the scenario teaches
There is rarely one right answer; there is a right answer for a stage of the project. Start simple, write down why, and switch when your situation changes. Our honest comparison of beginner-friendly databases covers more options.
A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.
Illustrative example: the organisations, people, projects and results described on this page are hypothetical. They do not describe a real client or engagement, and no consulting services are offered here.