Schema flexibility lets documents in the same collection use different key/value fields and shapes. This contrasts with SQL tables, where rows and columns follow a fixed schema. section 4.1.1
A flexible document schema changes how related data is organized:
- A board-game document can contain the board game and related comments together, reducing the need for separate collections. section 4.1.1
- Parent-child relationships are commonly embedded, while key-based relationships remain useful for entities referenced by multiple documents, such as users. section 4.1.1
- The resulting structure is loosely organized and denormalized rather than a highly normalized set of fixed tables. section 4.1.1
Board-game data
A document-oriented board-game database can store board-game details and their comments in one document, while user documents can retain roles and remain referenced from other documents. section 4.1.1
Compare the document-oriented schema diagram with the table-oriented alternative to see how flexible documents change collections and relationships. section 4.1.1


