The Relational Database Bottleneck
Learners will identify the scaling and flexibility pain points of SQL databases that motivated the NoSQL movement.
The Relational Database Bottleneck is a free MongoDB Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MongoDB Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Rise of Relational Databases
For decades, relational databases like MySQL and PostgreSQL ruled. They store data in neat tables of rows and columns, and they work great. So why look further?
The Rigid Schema Problem
SQL tables use a rigid schema: you must define every column up front. Changing it later means a migration that can lock the table and cause downtime.
-- Adding a column to a large table in PostgreSQL can be slow
ALTER TABLE users ADD COLUMN preferences JSONB;
-- On 100M rows this may require a full table rewrite
-- and blocks reads/writes for minutesScaling Up vs. Scaling Out
To grow, SQL usually scales up — a bigger, pricier server. But there's a ceiling. Modern apps need to scale out across many machines, which SQL handles awkwardly.
JOIN Performance at Scale
SQL splits data across tables and stitches it back with JOINs. That's fine when small, but on huge data, joining five tables per query gets slow.
-- A typical normalized SQL query joining 4 tables
SELECT o.id, c.name, p.title, oi.quantity
FROM orders o
JOIN customers c ON c.id = o.customer_id
JOIN order_items oi ON oi.order_id = o.id
JOIN products p ON p.id = oi.product_id
WHERE o.status = 'pending';The High-Traffic Write Problem
SQL locks rows to keep data safe with ACID transactions. Great for banks, but those locks struggle when you need millions of writes per second.
Unstructured and Semi-Structured Data
The web is full of semi-structured data like messy JSON. Forcing it into fixed columns means tons of empty fields or awkward workarounds.
-- EAV table: flexible but awkward to query
CREATE TABLE product_attributes (
product_id INT,
attr_name VARCHAR(50),
attr_value VARCHAR(200)
);
-- Querying all electronics by voltage is painful:
SELECT * FROM product_attributes
WHERE attr_name = 'voltage' AND CAST(attr_value AS INT) > 100;The Internet Scale Wake-Up Call
Around 2006, Google and Amazon hit real scaling walls and published their fixes. That sparked a whole new wave: NoSQL databases built for internet scale.
What NoSQL Does Differently
NoSQL trades some SQL rules for new strengths: flexible schemas, easy scaling across machines, and fast writes. Not always better — just optimized differently.
When RDBMS Still Wins
SQL still wins plenty: financial transactions, complex reports, and stable data. Most apps never outgrow a well-tuned PostgreSQL. Right tool for the job!
The Document Model as a Solution
MongoDB's answer is the document model. Instead of splitting a user across five tables, it stores everything together in one JSON-like document. The code below shows one.
// A MongoDB document stores related data together
{
_id: ObjectId('...'),
name: 'Alice',
email: 'alice@example.com',
address: { city: 'London', zip: 'EC1A' },
tags: ['premium', 'newsletter'],
createdAt: ISODate('2024-01-15')
}Horizontal Scaling Is Built In
MongoDB scales out with sharding — adding servers as you grow. Replica sets keep copies live, so if one node fails, another takes over automatically.
Quick Check
Test your understanding of MongoDB & NoSQL Databases concepts from this lesson.
Lesson Recap
You saw why SQL bottlenecks at huge scale, where JOINs and heavy writes hurt most, and how MongoDB's document model fixes it. Next: the four NoSQL families.
Frequently asked questions
Is the “The Relational Database Bottleneck” lesson free?
Yes — the full text of “The Relational Database Bottleneck” is free to read here on the web, and the MongoDB Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MongoDB Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Relational Database Bottleneck”?
Learners will identify the scaling and flexibility pain points of SQL databases that motivated the NoSQL movement. You practise MongoDB Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start MongoDB Academy?
No prior experience is required. MongoDB Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Relational Database Bottleneck” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this MongoDB Academy lesson?
Yes. Every MongoDB Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Relational Database Bottleneck
- NoSQL Flavors: Document, Key-Value, Column, Graph
- The CAP Theorem in Plain English
- Where MongoDB Fits In