Choosing the right database

Stage 2 · Lesson 5 of 6

Talking to it from code: drivers, ORMs and migrations

Relational databases: the sensible default

Your app talks to the database through a , the library that sends queries, or an ORM (object-relational mapper), such as Prisma, Django ORM, Entity Framework or SQLAlchemy, which maps tables to objects in your language. Either way, change your through migrations: small, versioned scripts kept in that add a column or an , run in order on every environment.

That way your laptop, a teammate's laptop and production all have the same tables. Always pass user input as query parameters, never by gluing strings into SQL, which prevents . ORMs speed up common work, but learn to read the SQL they produce.

Common trapediting the production schema by hand in a GUI and then not knowing why the app breaks elsewhere.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking Relational Database Design and Modeling

    Design Gurus · Intermediate · $98 one-time

    Data modelling, ER diagrams, keys and normalisation for the relational default, with worked designs

  • GuideFree
    PostgreSQL Tutorial

    PostgreSQL Global Development Group · Beginner

    The short official tutorial: create a database, tables and your first queries in an evening

Practise

  • Run SQL on PostgreSQL, MySQL or SQLite in the browser and compare how each handles JSON

  • Free interactive lessons if your SQL needs warming up before the hands-on task

Keep handy

Also worth your time

Mark this stage as not done?