Skip to content
recaplica

    One moment: security check

    Cloudflare wants to make sure you're not a robot. Tick the box below and your search will continue on its own.

    IT
    recaplica SQL vs NoSQL: How Relational and Non-Relational Databases Differ
    © 2026 Recaplica · recaplica.com — All rights reserved
    Home › Technology

    SQL vs NoSQL: How Relational and Non-Relational Databases Differ

    By Recaplica Newsroom · Updated on September 28, 2026

    What to print

    Page numbers appear when printing with default margins.

    Slides

    Choose a cut

    Flash10 slidesThe essential thread, to present in classFull14 slidesEvery chapter and the deeper detail

    Both come with speaker notes.

    Telegram channel
    recaplica Clear in 30 seconds, yours in 10 minutes.
    In 30 seconds Key points Figures Deep dive Slides Myths Mind map Quiz Flashcards FAQ

    In 30 seconds quick read

    A relational database stores data in tables with a fixed schema, set before a single row is ever written. A non-relational database, or NoSQL, uses flexible schemas built around one specific data model instead: documents as in MongoDB, key-value pairs as in Redis, partitioned wide columns as in Apache Cassandra, or nodes linked by relationships as in Neo4j. NoSQL databases emerged in the late 2000s, as storage got cheaper and systems increasingly needed to run across many machines at once. Choosing between the two isn't about which one is generally faster or more scalable — it depends on the shape of the data and the job at hand, since both can grow, just in different directions, and the CAP theorem explains the trade-off every distributed system faces the moment its network connections break.

    Key Points

    • A relational database has one fixed schema shared by every row in a table; a NoSQL database has a flexible schema built for one specific data model.
    • The four main NoSQL models are document, key-value, wide-column, and graph, each suited to a different kind of problem.
    • NoSQL databases took off in the late 2000s; MongoDB and CouchDB, two document databases, both arrived in 2009, according to MongoDB.
    • According to MongoDB, NoSQL databases are built to scale both vertically and horizontally, while relational databases are designed mainly for vertical scaling, with only limited horizontal capability.
    • The CAP theorem describes the trade-off between consistency and availability that a distributed system faces once communication between its nodes breaks down; some systems, like MongoDB, can be tuned toward either behavior.
    • In a document database, two entries in the same collection don't have to share the same fields: the structure is still there, it just varies from one entry to the next.

    Key figures

    • 2009 The year MongoDB and CouchDB arrived, according to MongoDB, among the first document-oriented NoSQL databases to catch on. Source: MongoDB — NoSQL Explained
    • late 2000s Period when NoSQL databases emerged, as storage costs dropped sharply. Source: MongoDB — NoSQL Explained

    Deep Dive

    Two ways to organize data

    A relational database starts from a schema decided ahead of time: tables with fixed columns, the same for every row, linked by primary and foreign keys. A non-relational database, or NoSQL, starts from the problem instead: it picks one specific data model — documents, key-value pairs, partitioned columns, or graphs — and shapes its schema around that model. According to AWS, NoSQL databases are often called “purpose-built” databases, designed for a specific job, with flexible schemas that adapt more easily than relational tables to modern applications.

    This isn’t a contest between an outdated model and a new one — neither replaces the other across the board. It’s a choice that depends on the shape of the data, how much scale is needed, and how much structure makes sense from day one.

    The four main NoSQL models

    AWS describes three of these models, each with a real product behind it. The document database stores data as JSON-like documents, flexible and semi-structured; MongoDB is a well-known example of this model. The key-value database maps every value to a key and is, according to AWS, highly partitionable, capable of horizontal scaling at a level other NoSQL types struggle to match: Amazon DynamoDB, for instance, aims for consistent performance with single-digit-millisecond latency at any scale of traffic. The graph database, such as Neo4j, is built for applications working with densely connected data. A fourth widely used model is wide-column, which partitions its tables around a partition key: Apache Cassandra is a well-known example.

    Practical example: in a graph database, a question like “what music do my friends listen to that I don’t have yet?” gets answered with a traversal, the query that walks nodes and relationships to find the answer. In a relational table, the same question would need several joins across different tables; in the graph, friends, listens, and tracks are already nodes tied together by direct relationships.

    A flexible schema, not the absence of one

    In the document model, each document holds pairs of field and value, and the values can be strings, numbers, booleans, arrays, or even other nested documents. Different documents in the same collection can carry different fields: that flexibility is exactly what makes the schema easier to change when it needs to. In the relational model, by contrast, the schema is fixed: every row in a table must hold the same predefined set of column types, and changing that schema after data has already been stored is far more involved.

    Redis, a key-value database, is a good reminder that “key-value” doesn’t just mean plain strings: alongside strings, it implements hashes, which behave like dictionaries of field-value pairs, unordered sets of unique strings, and lists ordered by insertion. A set in Redis lets you add, remove, and check for an element’s existence in constant time, no matter how many elements it holds.

    Scaling, vertical and horizontal

    Vertical scaling grows by adding resources to a single machine — more memory, more processing power. Horizontal scaling grows by adding more machines, often grouped into distributed clusters spread across several servers that can sit in different locations and talk to each other over the internet. According to MongoDB, relational databases are designed mainly for vertical scaling, with limited room to extend horizontally; NoSQL databases, on the other hand, are built to scale both vertically and horizontally, often through sharding, replication, and clustering.

    AspectRelational databaseNon-relational database
    SchemaFixed, defined in advanceFlexible, shaped by the chosen model
    Main scaling directionVerticalVertical and horizontal
    Typical data modelTabular, rows and columnsDocument, key-value, graph, or wide-column
    Good fit forStructured data, well-defined relationshipsSemi-structured data, large volumes, heavy traffic

    Apache Cassandra, a wide-column database, is a concrete example of that philosophy: its design goals include scaling out on commodity hardware, with throughput that grows linearly as processors are added, and online load balancing as the cluster grows.

    The CAP theorem: a trade-off, not a fixed label

    The CAP theorem describes the trade-offs a distributed database faces between consistency, availability, and partition tolerance whenever data is replicated across multiple nodes. Because partition tolerance is a requirement in any distributed environment, the real choice, according to MongoDB, comes down to keeping consistency or keeping availability the moment communication between nodes breaks down.

    It isn’t a permanent label stamped on a system, but a trade-off that kicks in when needed. MongoDB, for example, offers tunable settings, such as writeConcern and readPreference, that let teams balance accuracy, speed, and resilience — it can behave as a system leaning toward consistency or one leaning toward availability, depending on how it’s configured. Apache Cassandra, for its part, implements what its own documentation calls “eventually consistent” semantics: the nodes of the cluster converge on the same data over time, not necessarily right after every write.

    When one model fits better than the other

    According to MongoDB, teams choosing between a relational and a NoSQL database typically weigh factors like fast-paced agile development, the need to store structured data alongside semi-structured data, large data volumes, scale-out architecture requirements, or modern application patterns such as microservices and real-time streaming. A product catalog with clear relationships between customers, orders, and invoices remains a natural fit for a relational database. A recommendation system built on networks of connections, or a service that needs to absorb unpredictable traffic spikes with a lightning-fast lookup algorithm, tends to shift more easily toward a NoSQL model — document, graph, or key-value, depending on the problem.

    The choice comes down to the problem at hand: the shape of the data, how much that shape is likely to change over time, and how the system that holds it needs to grow.

    Slide deck

    Slides ready to download and make your own in PowerPoint or Google Slides, with speaker notes. Pick the Flash cut or the Full one.

    Slide 1 of the presentation on SQL vs NoSQL: SQL vs NoSQLSlide 2 of the presentation on SQL vs NoSQL: Tables aren't the only way to organize dataSlide 3 of the presentation on SQL vs NoSQL: What's aheadSlide 4 of the presentation on SQL vs NoSQL: Chapter 01: The non-relational modelsSlide 5 of the presentation on SQL vs NoSQL: One example per model: MongoDB, Redis, Neo4jSlide 6 of the presentation on SQL vs NoSQL: Chapter 02: Fixed schema or flexible schemaSlide 7 of the presentation on SQL vs NoSQL: Two schema philosophiesSlide 8 of the presentation on SQL vs NoSQL: Documents stay organized, even with different fieldsSlide 9 of the presentation on SQL vs NoSQL: Chapter 03: Scaling, vertical and horizontalSlide 10 of the presentation on SQL vs NoSQL: Vertical · Both ways · CassandraSlide 11 of the presentation on SQL vs NoSQL: Chapter 04: The CAP theoremSlide 12 of the presentation on SQL vs NoSQL: The CAP theoremSlide 13 of the presentation on SQL vs NoSQL: What happens when communication between the nodes of a distributed system breaks down, according to the CAP theorem?Slide 14 of the presentation on SQL vs NoSQL: Keep reading
    Flash10 slidesThe essential thread, to present in classFull14 slidesEvery chapter and the deeper detail

    Common myths

    • ✗ Myth A NoSQL database has no schema at all.

      ✓ Reality According to MongoDB, NoSQL databases offer flexible schemas: different documents in the same collection can carry different fields, which is a world away from the rigidity of a relational table, but it doesn't mean the data is unstructured.

    • ✗ Myth A key-value database like Redis only handles simple key-value pairs.

      ✓ Reality Redis implements several data types beyond plain strings, including hashes, sets, and ordered lists, according to its own documentation; a set, for instance, lets you check whether an element exists in constant time, no matter how many elements it holds.

    • ✗ Myth Non-relational databases are always faster or more scalable than relational ones.

      ✓ Reality According to MongoDB, relational databases can extend some horizontal scaling capability of their own, and distributed NoSQL systems pay a price described by the CAP theorem: availability is gained at the expense of consistency only once the network between nodes breaks down, not as a constant rule.

    Mind map

    Drag the background to move around and the nodes to reposition them; use − and + to collapse and expand branches.

    Customize
    Mind map: SQL vs NoSQL: How Relational and Non-Relational Databases Differ
    • Relational vs non-relational databases
      • The relational model
        • Fixed schema tables defined in advance, the same set of columns for every row
        • Vertical scaling built to grow by adding resources to one machine
      • Document databases
        • JSON-like documents fields and values, even nested, close to application code
        • Flexible schema different documents in the same collection can hold different fields
        • Example, MongoDB according to MongoDB, arrived in 2009 alongside CouchDB
      • Key-value databases
        • Access by key not just plain strings, also hashes, sets, and lists
        • Strong horizontal scaling highly partitionable, according to AWS
        • Example, Redis data structure server for caching and queues
      • Graph databases
        • Nodes and relationships every relationship carries a direction and a type
        • Traversal the query that walks the graph to find connections
        • Example, Neo4j often described as schema-optional
      • Wide-column databases
        • Partitioning tables split according to a partition key
        • Eventual consistency nodes catch up over time, not at the instant of the write
        • Example, Apache Cassandra built for scale-out on commodity hardware
      • The CAP theorem
        • Consistency every node sees the same data at the same time
        • Availability the system keeps answering requests
        • Partition tolerance the system keeps working even if the network splits

    Quiz: test yourself

    Answer the questions to check what you have learned: you get instant feedback and a short explanation.

    Grade 0/10 0/5
    1 What's the main schema difference between a relational and a NoSQL database?

    According to MongoDB, a relational database has a fixed schema, with the same set of columns for every row, while a NoSQL database has a flexible schema that adapts to the data model it's built around.

    2 Which of the four NoSQL models does MongoDB belong to, in AWS's classification?

    AWS lists Amazon DocumentDB, which is MongoDB-compatible, among its examples of document databases: the data is stored as JSON-like documents made of fields and values.

    3 What does the CAP theorem describe?

    According to MongoDB, the CAP theorem describes the trade-offs distributed databases face between consistency, availability, and partition tolerance when data is replicated across nodes; since distributed systems have to tolerate network partitions anyway, the real choice comes down to consistency or availability.

    4 True or false: non-relational databases can only scale horizontally, never vertically.

    False. According to MongoDB, NoSQL databases are designed to scale both vertically and horizontally, while relational databases are built mainly for vertical scaling.

    5 In a graph database like Neo4j, what is a traversal?

    According to Neo4j, a traversal is how you query a graph to answer questions like what music your friends like that you don't own yet, or which services are affected if one component goes down.

    Answers: 1-A · 2-A · 3-A · 4-B · 5-A

    Flashcards

    Tap the card to flip it and check whether you remember the answer, then move to the next one.

    1 / 8

    Explain it in your own words

    The ultimate test: if you can explain it in simple words, you've truly understood it. Write your explanation, then compare it with the Recap.

    Your explanation is saved only on this device.

    A relational database stores data in tables with a fixed schema, set before a single row is ever written. A non-relational database, or NoSQL, uses flexible schemas built around one specific data model instead: documents as in MongoDB, key-value pairs as in Redis, partitioned wide columns as in Apache Cassandra, or nodes linked by relationships as in Neo4j. NoSQL databases emerged in the late 2000s, as storage got cheaper and systems increasingly needed to run across many machines at once. Choosing between the two isn't about which one is generally faster or more scalable — it depends on the shape of the data and the job at hand, since both can grow, just in different directions, and the CAP theorem explains the trade-off every distributed system faces the moment its network connections break.

    Frequently asked questions

    What is the difference between SQL and NoSQL databases?

    A relational (SQL) database stores data in tables with one fixed schema shared by every row; a non-relational (NoSQL) database uses a flexible schema built for a specific data model, such as documents, key-value pairs, partitioned columns, or graphs.

    What are some examples of non-relational databases?

    MongoDB for the document model, Redis for the key-value model, Apache Cassandra for the wide-column model, and Neo4j for the graph model are among the most cited NoSQL examples, each suited to a different use case.

    What are the types of NoSQL databases?

    AWS groups NoSQL databases into four main types: document databases, such as MongoDB, for JSON-like data; key-value databases, such as Redis, for fast lookups by key; graph databases, such as Neo4j, for highly connected data; and wide-column databases, such as Apache Cassandra, for tables partitioned at scale.

    Are non-relational databases always faster than relational ones?

    No. Relational databases can still extend some horizontal scaling capability of their own, and for distributed NoSQL systems, the availability advantage described by the CAP theorem only kicks in once communication between nodes breaks down — it isn't a constant rule.

    RDBMS vs NoSQL: how do they compare on schema and scaling?

    An RDBMS (relational database management system) stores data in tables with a fixed schema and scales mainly vertically, by upgrading one machine. A NoSQL database uses a schema built for its data model and, according to MongoDB, is designed to scale both vertically and horizontally, often through sharding, replication, and clustering.

    Sources

    • AWS — NoSQL Database
    • MongoDB — NoSQL Explained
    • Redis — Redis data types
    • Neo4j — Graph database concepts
    • Apache Cassandra — Architecture overview
    • MongoDB — Mastering the CAP Theorem

    Every Recap goes through an independent review before publication.

    Every evening, the day's new Recaps on our Telegram channel. Join the channel →

    Keep learning

    • Technology DBMS: What It Is, the Main Types, and Real Examples A DBMS, short for database management system, is the software that lets people create, query and update the data in a database without having to know how that data is physically stored. Compared with spreadsheets or scattered files, it keeps data in one place and more consistent, cutting down on duplication and security gaps. The most common type is the relational model, which organizes data into linked tables and is queried with SQL. Nonrelational, or NoSQL, systems handle more flexible data, and two older models, hierarchical and network, sit alongside an object-oriented model. Read the Recap →
    • Technology ER Diagram (Entity-Relationship Diagram): What It Is and How to Build One An entity-relationship diagram, or ER diagram, is the map database designers draw before building a database: it shows which objects need tracking (entities), what information describes them (attributes) and how they connect to each other (relationships). It's a conceptual design step, not the finished database schema — the translation into real tables comes later. The two most common notations are Chen, which uses rectangles and ovals, and Crow's Foot, which uses lines ending in circles, bars and crow's feet to show how many instances connect. A relationship can be one-to-one, one-to-many or many-to-many, and each type has its own way of being drawn. Read the Recap →
    • Technology Relational Database: How Tables, Rows, and Keys Organize Data A relational database stores data in tables, each one dedicated to a single subject, such as customers or orders. Every row in a table is a record, and every column is a field holding the same kind of value across all rows. A primary key identifies each row uniquely, while a foreign key connects it to a row in another table, so information stays consistent without being copied everywhere. Tables combine through three kinds of relationships — one-to-one, one-to-many, many-to-many — and are queried with SQL, the standard language of these systems. Read the Recap →

    recaplica

    Clear in 30 seconds, yours in 10 minutes.

    Recaps Mind maps Request a Recap Telegram channel Mind map maker Our method About Privacy & cookies Legal notes & terms of use

    © 2026 Recaplica · A project by Curi S.r.l. — VAT IT05472000750

    Statistics, only if you say so

    To learn which Recaps help most we would use Google Analytics, with aggregate, anonymous data. It starts only with your OK, and you can change your mind anytime. Privacy policy