Backend development

Stage 2 of 7 · 10 lessons · ~3 months

Relational databases and SQL

Almost every backend is a careful wrapper around a relational database. Learn to model data, write SQL by hand, index it for real queries and understand what your ORM does on your behalf.

Start: Queries and joins

Lessons· one lesson for each topic, in this order

  1. 1Queries and joins
  2. 2Grouping and aggregates
  3. 3Data modelling and normalisation
  4. 4Keys, constraints and relationships
  5. 5Indexes
  6. 6Reading query plans with EXPLAIN
  7. 7Transactions and ACID
  8. 8Isolation levels and locking
  9. 9Prisma or Drizzle: schema and migrations
  10. 10The N+1 query problem

Start with· follow one of these

Practise

Also worth your time

Before moving on: Design a PostgreSQL schema for a small booking or ordering system, write the ten queries it needs by hand, add indexes and show with EXPLAIN ANALYZE that they are used.

Tauseef's advice
Write raw SQL before you touch an ORM, otherwise you will never notice when it fires a hundred queries to render one page. Learn on PostgreSQL; it is the safest default and what most new projects pick.

Mark this stage as not done?