Understand database choices without jargon, then practise modeling and querying a small product.
A database is an organized memory for a product. A spreadsheet can be enough for a small manual workflow. A database becomes valuable when many users or programs must read and update information consistently.
flowchart TD
Need[What information must the product remember?] --> Shape{What shape and guarantees?}
Shape -->|Related records and transactions| SQL[Relational / SQL]
Shape -->|Flexible document-shaped records| Doc[Document / NoSQL]
SQL --> Engines[PostgreSQL or MySQL]
Doc --> Mongo[MongoDB]
Engines --> Ops[Indexes, backup, security, monitoring]
Mongo --> Ops
Relational databases organize data into tables with defined columns and relationships. SQL describes the result you want.
SELECT topics.title
FROM topics
LEFT JOIN completions
ON completions.topic_id = topics.id
AND completions.learner_id = 42
WHERE completions.topic_id IS NULL
ORDER BY topics.title;
PostgreSQL and MySQL are both capable general-purpose choices. PostgreSQL often appeals when a team wants rich SQL features and extensibility. MySQL is widely used and has a large operational ecosystem. For a beginner project, whichever is easiest to run and receive support for is usually the right first choice.
PL/SQL is Oracle's procedural extension to SQL. Learn it when you work with an Oracle system, not as a prerequisite for understanding databases.
MongoDB stores document-shaped records resembling JSON. This can be convenient when related values are usually read together. Flexible shape does not mean “no design”: identifiers, validation, indexes, growth, and update patterns still need deliberate decisions.
| Need | Good starting direction |
|---|---|
| Orders, payments, inventory | Relational database and transactions |
| Flexible content records | Consider a document database |
| Relationships and reporting | Relational database |
| Temporary cache or counters | A specialized store such as Redis |
This is a starting heuristic, not a universal rule.
Write down the questions the product must answer. For a learning tracker:
Then sketch records and relationships. Use sample data and test the important queries before optimizing anything.
A working query is only the beginning. Production data needs access control, validated inputs, backups that have been restored in a test, monitoring, and a change process. Indexes should follow real query patterns. Replication and partitioning solve scale and availability problems, but add failure modes.
learners, topics, and completions.The last step turns “we have backups” into evidence that recovery works.
Databases provide durable shared state plus controlled reads, writes, concurrency, constraints, recovery, and querying—problems that ordinary files alone do not solve safely at scale.
Tables organize related rows, documents group nested fields, keys identify and connect records, indexes accelerate selected access paths, and transactions protect multi-step invariants.
Choose a database from access patterns, consistency, relationships, scale, operational skills, and change needs—not fashion. SQL and NoSQL are broad families with overlapping capabilities.