Data Models and Query Languages Summary - rFronteddu/general_wiki GitHub Wiki

Data started out being represented as one big tree (the hierarchical model), but that was not optimal for representing many-to-many relationship, so the relation model was invented to solve that problem. Some applications don't fit well into this model either. New nonrelation datastores ("NoSQL") have diverged in two main directions:

  1. Document databases target use cases where data comes in self-contained documents and relationships between one document and another are rare.
  2. Graph Databases go in the opposite direction, targeting use cases where anything is potentially related to everything.

Al three models are widely used today, and each is good in its respective domain. While one model can be emulated in terms of another, this is often awkward.

One thing graph and document db have in common is that they typically don't enforce a schema for the data they store, this makes it easier to adapt applications to changing requirement but forces application to make assumptions about the data structure. This is the tradeoff between explicit (enforced on write) or implicit (handled on read) schema.

  • RDBMS

  • NoSQL

  • Graph

  • Use relational databases for structured data, strong consistency, and complex queries.

  • Use document databases for flexible, schema-less data, and horizontal scalability.

  • Use graph databases for complex relationships and graph-specific algorithms.