© Guy Harrison, Michael Harrison 2021
G. Harrison, M. HarrisonMongoDB Performance Tuninghttps://doi.org/10.1007/978-1-4842-6879-7_4

4. Schema Modelling

Guy Harrison1   and Michael Harrison2
(1)
Kingsville, VIC, Australia
(2)
Derrimut, VIC, Australia
 

In databases, the schema defines the internal structure or organization of the data. In relational databases like MySQL or Postgres, the schema is implemented as tables and columns.

MongoDB is often described as a schema-free database, but this is somewhat misleading. By default, MongoDB does not enforce any particular document structure, but all MongoDB applications will implement some sort of document model. It’s therefore more accurate to describe MongoDB as supporting flexible schemas.

In MongoDB, a schema ...

Get MongoDB Performance Tuning: Optimizing MongoDB Databases and their Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.