Skip to main content

Command Palette

Search for a command to run...

πŸ’Ύ SQL vs NoSQL Explained Like You're 5

Published
β€’2 min read
S

Building AI systems and writing about how they actually work. Master of AI @ University of Technology Sydney. Previously B.Tech CS with focus on IoT. I believe the best way to learn is to explain. That's why I'm documenting tech concepts with simple analogies (@sreekarreddy.com). AWS Certified β€’ Azure AI Certified β€’ Neo4j Professional β€’ Google Data Analytics When not coding: exploring Sydney, working on side projects, and teaching tech to anyone who'll listen.

Filing cabinet vs storage bins

Day 14 of 149

πŸ‘‰ Full deep-dive with code examples


Two Ways to Store Things

Filing Cabinet (SQL):

  • Organized folders
  • Each drawer has same structure
  • Everything has a place
  • Finding things: easy!

Storage Bins (NoSQL):

  • Flexible containers
  • Throw anything in
  • Different boxes, different stuff
  • Finding things: depends!

SQL Databases

Structured Query Language

Think spreadsheets with strict rules:

idnameemailage
1Sreekarsreekar@email.com25
2Alexalex@email.com30

Rules:

  • Every row has same columns
  • Can't add random new columns
  • Data types are usually enforced (age is typically a number)

Good for: Banking, orders, anything needing consistency


NoSQL Databases

NoSQL databases often have more flexible structure

{
  "name": "Sreekar",
  "email": "sreekar@email.com",
  "hobbies": ["coding", "reading"],
  "address": {
    "city": "Sydney"
  }
}

Can store:

  • Different fields per record
  • Nested data
  • Lists and objects

Good for: Social media, real-time apps, changing requirements


Quick Comparison

SQLNoSQL
Tables with rowsDocuments or key-value
Fixed structureFlexible structure
Joins are easyJoins are hard
Scale verticallyScale horizontally
MySQL, PostgreSQLMongoDB, Redis

In One Sentence

SQL uses rigid tables for structured data; NoSQL uses flexible formats for varied, evolving data.


πŸ”— Enjoying these? Follow for daily ELI5 explanations!

Making complex tech concepts simple, one day at a time.

More from this blog

esreekarreddy

132 posts