Tutorials › Core Cloud Architecture › Databases: Relational and NoSQL

Core Cloud Architecture · Part 6 of 13

Databases: Relational and NoSQL

Relational and NoSQL databases, and how to choose between them.

A database is where data goes once it needs to be queried, filtered, joined, and updated transactionally. Relational and NoSQL are the two main families, built on different assumptions about how data will be read. A few specialized categories cover access patterns neither fits well.

Relational databases

A relational database organizes data into tables with a fixed schema (every row in a table has the same columns, of a declared type) and lets you combine data across tables at query time with a join. Queries are written in SQL, a declarative language for describing the data you want.

Relational databases guarantee ACID transactions: a group of operations either all succeed or all roll back together (atomicity), the database moves between valid states only (consistency), concurrent transactions don't see each other's half-finished work (isolation), and a committed transaction survives a crash (durability). This matters where correctness can't be approximate: moving money between two accounts, decrementing inventory when an order is placed, anywhere "half of this happened" is a bug.

An index lets the database find matching rows without scanning the whole table, at the cost of extra storage and added work on every write, since the database keeps each index in sync with the table. A read replica is a copy of the database kept up to date from the primary, usually asynchronously so reads can lag slightly, used to serve read queries so the primary isn't the only thing handling load. Partitioning (or sharding) splits a large table across multiple underlying stores, which becomes necessary once a single database instance can't hold or serve the data volume. The cost is complexity: queries spanning partitions, and transactions across partitions in particular, get considerably harder.

NoSQL databases

NoSQL is an umbrella term covering several different data models that all relax the fixed-schema, join-everything-at-query-time relational approach in exchange for something else: one access pattern served far faster, or scale characteristics a single relational instance struggles with.

Specialized categories

ConceptAWSGCPAzure
Managed relational (standard engines)RDSCloud SQLAzure SQL Database / Azure Database for PostgreSQL
Cloud-native relational, high scaleAuroraAlloyDBAzure SQL Database (Hyperscale)
Globally distributed, strong consistencyAurora DSQLSpannerNo direct equivalent
Key-value / documentDynamoDBFirestoreCosmos DB
Wide-columnKeyspaces (Cassandra-compatible)BigtableCosmos DB (Cassandra API)
Data warehouseRedshiftBigQueryAzure Synapse Analytics / Microsoft Fabric Data Warehouse

SQL vs. NoSQL

Three questions separate the two families.