Backend essentialsIntermediate10h

Databases.

Relational basics and storing your app's data.

What are databases for full-stack?

The database is where your app's data persists. For full-stack work you need relational fundamentals — tables, relationships, and SQL — usually with PostgreSQL. Enough to model data, query it, and not lose it, even if a backend specialist would go deeper into tuning and operations.

Why it matters

Data is the heart of most apps, and the schema is a decision the entire app leans on for its lifetime. Getting relationships and queries right keeps the app correct and fast; getting them wrong causes bugs that ripple into every layer. This node feeds directly into the ORM and data-layer stages.

What to learn

  • Tables, rows, columns, and types
  • Primary and foreign keys, and relationships
  • SQL: SELECT, INSERT, UPDATE, DELETE, JOIN
  • Normalization basics
  • Indexes and why queries get slow
  • Transactions for multi-step writes
  • PostgreSQL as a sensible default

Common pitfall

Building queries by concatenating user input into SQL strings, opening the door to SQL injection — still one of the most exploited vulnerabilities. Always use parameterized queries (or an ORM that parameterizes for you) so input is data, never executable SQL. The ORM node builds on this.

Resources

Primary (free):

Practice

Model a small app's data in PostgreSQL: two or three related tables with keys. Write queries to insert data and to join and read it across tables, using parameterized queries. Add an index to a column you filter on. Done when the joins return correct results and queries are parameterized.

Outcomes

  • Model data with tables, keys, and relationships.
  • Write SQL queries including joins.
  • Use parameterized queries to prevent injection.
  • Add an index to speed up a filtered query.
Back to Full-Stack roadmap