Skip to content

Database Types

Not all data is the same shape. Different database types are optimized for different data patterns.


TypeExampleData ShapeUse Case
RelationalPostgreSQL, MySQLTables with rowsTransactions, inventory
DocumentMongoDB, CouchbaseJSON-like documentsUser profiles, catalogs
Key-ValueRedis, DynamoDBKey → value pairsCache, session store
Wide-ColumnCassandra, BigtableRows with many columnsTime-series, IoT
GraphNeo4j, ArangoDBNodes + edgesSocial networks, recommendations
Time-SeriesInfluxDB, TimescaleDBTimestamp → valueMetrics, monitoring

flowchart TB
Q1{"Data has strong<br/>relationships,<br/>needs JOINs?"}
Q1 -->|Yes| SQL["Relational (PostgreSQL)"]
Q1 -->|No| Q2{"Schema is<br/>flexible or<br/>changes often?"}
Q2 -->|Yes| Q3{"Data structure<br/>looks like<br/>documents?"}
Q2 -->|No| Q4{"Primary access<br/>is by key?"}
Q3 -->|Yes| Doc["Document (MongoDB)"]
Q3 -->|No| GraphQ{"Need to traverse<br/>relationships?"}
GraphQ -->|Yes| Graph["Graph (Neo4j)"]
Q4 -->|Yes| KV["Key-Value (Redis)"]
Q4 -->|No| WC{"Massive write<br/>volume, time-ordered?"}
WC -->|Yes| Col["Wide-Column (Cassandra)"]
WC -->|No| TS["Time-Series (InfluxDB)"]
style SQL fill:#7c3aed,color:#fff
style Doc fill:#4f46e5,color:#fff
style KV fill:#6366f1,color:#fff
style Col fill:#8b5cf6,color:#fff
style Graph fill:#059669,color:#fff
style TS fill:#059669,color:#fff

DatabaseRead PerfWrite PerfConsistencyScalability
RelationalMediumMediumStrongHard
DocumentHighHighTunableGood
Key-Value⚡ Very High⚡ Very HighUsually eventualExcellent
Wide-ColumnHigh⚡ Very HighEventualExcellent
GraphMedium (traversal)Low (nodes)StrongHard
Time-SeriesHigh (range)⚡ Very HighEventualGood

  • Use the database that matches your data shape — don’t force a square peg into a round hole.
  • Relational for structured, joined data. Document for JSON-like objects. KV for fast lookups.
  • Wide-column for write-heavy time-series. Graph for connected data (friends, recommendations).