Databases in practice
Choose SQLite, PostgreSQL, or MySQL
Choose a relational database based on deployment, concurrency, operational needs, and the environment that will run it.
SQLite stores a database in one file and runs inside your application process. It is excellent for local tools, prototypes, and many small applications.
There is no server to install and nothing to keep running. Your application opens the file directly:
sqlite3 app.db "CREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT);"
That one command created a complete database. Copying app.db is a full backup. This is why SQLite is everywhere: phones, browsers, and a huge number of single-server web apps.
The limit is concurrency. SQLite handles many readers at once, but only one writer at a time. If your app runs on one machine and writes are not constant, that’s fine. When several processes fight over writes, you start seeing SQLITE_BUSY errors, and that is the signal you have outgrown it.
When you want a server
PostgreSQL and MySQL run as database servers. They are a better fit when several application instances or users need concurrent network access and stronger operational tooling.
Your application connects to a server database over the network with a connection string:
postgres://app_user:[email protected]:5432/app
mysql://app_user:[email protected]:3306/app
A server database accepts many concurrent connections, manages its own users and permissions, and supports replication and point-in-time recovery. The price is operations: someone must install it, patch it, back it up, and keep it running. That someone is you, or a managed hosting provider you pay.
Which one?
Both servers are proven at enormous scale. My advice for a new project is PostgreSQL: it is stricter about your data, and features like rich column types and strong JSON support age well. Pick MySQL when your team or your hosting is already built around it.
A common mistake is starting a small single-server project on a database server “to be ready for scale”. You pay the operational cost immediately, for capacity you may never need. Moving from SQLite to PostgreSQL later is a well-understood migration.
All three are capable relational databases. Prefer the simplest one that satisfies the real requirements.
Lesson completed