Theo's Corner
dev / irl / thoughts
← Back
tech

What is a database and which one should you use

Theo|Jul 2026|~5 min read

Databases are one of those things that sound intimidating until you understand what they actually are, at which point they become one of the most useful tools in your toolkit. Here's the plain explanation.

What a database actually is

A database is just an organised way to store and retrieve data. That's it. Instead of dumping everything into text files and trying to search through them manually, a database gives you a structured system with proper querying, indexing, and relationships between pieces of data. You ask it questions — "give me all users who signed up this week" — and it answers fast.

Relational vs non-relational

The big split in the database world is between relational (SQL) and non-relational (NoSQL) databases. Relational databases store data in tables with rows and columns, like a very powerful spreadsheet. Relationships between tables are defined explicitly — a users table, an orders table, a foreign key linking them. PostgreSQL and MySQL are the main ones. Non-relational databases store data differently — as documents, key-value pairs, graphs. MongoDB is the most well known.

For most web applications, a relational database is the right choice. The structure it imposes is a feature, not a limitation — it forces you to think clearly about your data model upfront, which saves pain later.

PostgreSQL

PostgreSQL is what I use for almost everything. It's open source, extremely feature-rich, handles complex queries well, and has excellent support in every language and framework. The the panel runs on PostgreSQL. For a production backend that needs to be reliable and correct, Postgres is the answer in most cases.

SQLite

SQLite is a database that lives in a single file on disk — no server required. It's excellent for small projects, local tools, development environments, or anything where you don't need concurrent writes from multiple sources. If you're building a personal tool or a small app, SQLite removes all the setup overhead and just works.

Redis

Redis isn't really a primary database — it's an in-memory data store, which means it's extremely fast but doesn't persist data the same way. It's perfect for caching, session storage, rate limiting, queues — things that need to be fast and don't need to live forever. I use it alongside PostgreSQL in most projects: Postgres for the real data, Redis for the fast temporary stuff.

Which one should you use

For a new web project: PostgreSQL as your primary database, Redis if you need caching or sessions, SQLite if it's something small and local. That covers the vast majority of use cases. Don't reach for MongoDB unless you have a specific reason — the flexibility it offers is usually not worth the structure you give up.