Skip to content
Course contents

Data Models and Query Languages

The shape you force your data into decides what is easy, what is slow, and what is impossible. Choose it on purpose.

5 lessons1 lab1 hr 28 min

What you will be able to do

  • Explain the object-relational mismatch concretely, and say what an ORM is actually buying you
  • Decide between a document model and a relational model using the shape of the relationships, not fashion
  • Say why a many-to-many relationship pushes you back toward joins whatever database you started with
  • Read and write a declarative query, and explain why declarative wins on a query planner and loses on control
  • Recognise the problems where a graph model beats both

Every application has some real-world thing it is about — an order, a patient, a song — and every database forces you to write that thing down in a particular shape. The shape is the data model, and picking one is the most consequential decision in the project, because it silently decides which future features are a morning’s work and which are a rewrite.

This module walks the three shapes worth knowing — documents, relations, and graphs — and the question that actually chooses between them, which is not “which database is fastest” but “what do the relationships in my data look like, and which way do the queries run across them?”

Along the way, query languages: why saying what you want beats saying how to get it in almost every case, and what you give up in the rare cases where it doesn’t.

Read alongsideChapter 2 of Designing Data-Intensive Applications.

In this module6

Start module 2