Reference · Diagram Design

Relational vs Non-Relational Databases

Five database types by language, use case, engine and managed service — plus whether each leans toward reads or writes, and why PostgreSQL is an engine, not a language.

Relational and non-relational database types compared A reference in four layers. The first separates three things people confuse: the query language, the database engine that implements it, and the managed service that runs that engine for you — worked through with SQL, PostgreSQL and Supabase. The second covers relational databases. The third covers four non-relational types: Key-Value, Document, Graph and Column-Family, each with its language, use case, engines, managed services, read or write bias and an example query. The fourth plots all five types on a read-versus-write spectrum. A closing note explains that object storage such as Cloudflare R2 and Amazon S3 is not a database. THREE THINGS PEOPLE CONFUSE LAYER 1 · THE STANDARD Language What you write. A standard, not software. SQL · Cypher · CQL · MQL SQL is an ANSI standard — many engines speak it. LAYER 2 · THE SOFTWARE Engine The actual database program that runs. PostgreSQL · MySQL · SQLite · MongoDB · Redis PostgreSQL is open-source software, not a language. LAYER 3 · SOMEONE ELSE RUNS IT Managed service A hosted engine, plus extras around it. Supabase · Neon · Cloudflare D1 · PlanetScale Supabase is PostgreSQL — with auth and APIs added. Worked example: SQL is the language → PostgreSQL is an engine that implements it → Supabase is a platform that runs that engine for you. RELATIONAL (SQL) TABLES · ROWS · COLUMNS Relational Language: SQL — SELECT, INSERT, UPDATE, JOIN across normalized tables Use case: Financial systems, e-commerce orders, ERP — anywhere integrity across tables matters Engines: PostgreSQL, MySQL, Oracle Database, Microsoft SQL Server, SQLite Managed: Supabase (Postgres) · Neon (Postgres) · Cloudflare D1 (SQLite) · PlanetScale (MySQL) · AWS RDS Read vs write: Balanced — ACID-safe writes; joins make complex reads costlier at scale NON-RELATIONAL (NOSQL) KEY-VALUE Key-Value Language: GET / SET, provider APIs Use case: Caching, sessions, flags Engines: Redis, Valkey, Memcached Managed: Cloudflare KV, DynamoDB Read/write: Both — O(1) lookups Example: SET session:1234 val DOCUMENT Document Language: JSON/BSON (MQL) Use case: Catalogs, profiles, CMS Engines: MongoDB, CouchDB Managed: Atlas, Firestore Read/write: Read — no joins needed Example: db.products.find({}) GRAPH Graph Language: Cypher, Gremlin Use case: Social graphs, fraud Engines: Neo4j, JanusGraph Managed: Neo4j Aura, Neptune Read/write: Read — O(1) traversal Example: MATCH (u)-[:LIKES]->(p) COLUMN-FAMILY Column-Family Language: CQL Use case: Time-series, IoT logs Engines: Cassandra, HBase Managed: Astra, Bigtable Read/write: Write — LSM-tree Example: SELECT * FROM events READ VS WRITE, AT A GLANCE ◄ READ-OPTIMIZED BALANCED WRITE-OPTIMIZED ► Graph read-optimized Key-Value both — O(1) Column-Family write-optimized Document read-leaning Relational balanced (ACID) Not a database: Cloudflare R2 · Amazon S3 · Supabase Storage are object storage — files in buckets, fetched by key. They hold blobs: images, video, backups, data-lake files. No query language, no joins, no indexes. Usually paired with a database that stores the metadata. FOCAL — THE LAYER MOST OFTEN MISTAKEN FOR A LANGUAGE THE READ ↔ WRITE SPECTRUM