Learn SQL first. SQL (relational) databases store data in tables with fixed schemas and strong transactions, and they're used almost everywhere. NoSQL databases such as MongoDB store flexible documents and suit changing data shapes. Once you know SQL, learning NoSQL is quick, and many real apps use both.
SQL vs NoSQL at a glance
| SQL (relational) | NoSQL (e.g. document) | |
|---|---|---|
| Data model | Tables with rows and columns | Documents, key-value pairs, wide columns or graphs |
| Schema | Defined up front | Flexible |
| Relationships | Joins across tables | Usually embedded or referenced documents |
| Transactions | Strong (ACID) by design | Varies by database |
| Scaling style | Traditionally vertical, with sharding options | Often designed for horizontal scaling |
| Examples | PostgreSQL, MySQL | MongoDB, Redis, Cassandra, Neo4j |
| Good for | Payments, orders, accounts, reporting | Profiles, content, catalogues, caching, feeds |
Why learn SQL first?
- Most business and analytics data lives in relational databases.
- SQL is a stable, widely used language, and the skills transfer between databases.
- Concepts such as keys, normalisation and transactions teach you to think clearly about data.
When should you choose NoSQL?
Choose a document database when your data is naturally document-shaped and changes often (user profiles with optional fields, product catalogues), when you need a fast cache or session store (Redis), or when you're modelling connections (graph databases). A common real-world design uses PostgreSQL for payments and accounts, MongoDB for content, and Redis for caching.
Databases in Program Zero
Phase 3 covers relational design and normalisation, SQL (joins, subqueries, window functions), PostgreSQL or MySQL, MongoDB, Redis and ORMs. The project is a full database schema for a WhatsApp-like and Instagram-like app, which you then build in the full-stack phase.