Data & storage · Intermediate · 9 min

SQL vs NoSQL

Begin with queries and invariants before selecting a storage label.

STEP 1 / 10
Model related records — isometric concept diagramChoose a model from operations and invariants. Components: 1. Product client. Representative clients, not a literal user count; 2. Application. Logical component or processing boundary; 3. Relational database. Durable or explicitly scoped state. Connections: 1. Product client to Application: Model related records; 2. Application to Product client: Reply: Application; 3. Application to Relational database: Model related records; 4. Relational database to Application: Reply: Relational database. Illustrations are conceptual, not deployed capacity or user counts.Product client → Application: Model related records1Application → Product client: Reply: Application2Application → Relational database: Model related records3Relational database → Application: Reply: Relational database4Product client: representative traffic illustration; figure count is not a workload measurement.1Product clientRepresentative clients, not aliteral user countApplication: Logical component or processing boundary2ApplicationLogical component or processingboundaryRelational database: Durable or explicitly scoped state3Relational databaseDurable or explicitly scoped state
1Product client2Application3Relational database
  1. 1Product client → ApplicationRequestModel related records
  2. 2Application → Product clientReplyReply: Application
  3. 3Application → Relational databaseRequestModel related records
  4. 4Relational database → ApplicationReplyReply: Relational database

Conceptual illustration · figures do not imply user counts, deployed capacity or replica counts.

3 components visible · Product client + Application + Relational database highlighted

Orange: request / query · Blue: reply · Purple: event / control · Arrows show direction; speed is illustrative.

You’ll learn

  • Describe access patterns and integrity rules.
  • Compare relational joins with document aggregation.
  • Separate data model choice from consistency guarantees.

PUT THE IDEA TO WORK

From learning to practice

RELATED PATTERNS

CQRS & materialized views ↗

Further reading

PostgreSQL · Constraints ↗