Learning Library

← Back to Library

SQL vs NoSQL: Key Differences

Key Points

  • SQL databases are relational and require a predefined schema, while NoSQL databases are non‑relational and let you add structure later.
  • SQL systems typically scale vertically by adding more CPU/Memory, whereas NoSQL platforms scale horizontally by adding additional nodes.
  • Data in SQL is organized into tables with rows and explicit relationships; NoSQL stores data as flexible documents, key‑value pairs, or graph structures.
  • Querying SQL relies on a fixed query language and pre‑planned joins, while NoSQL offers more dynamic, schema‑agnostic query capabilities.
  • SQL excels at handling multi‑row, ACID‑compliant transactions, a strength that many NoSQL solutions do not prioritize.

Full Transcript

# SQL vs NoSQL: Key Differences **Source:** [https://www.youtube.com/watch?v=Q5aTUc7c4jg](https://www.youtube.com/watch?v=Q5aTUc7c4jg) **Duration:** 00:06:04 ## Summary - SQL databases are relational and require a predefined schema, while NoSQL databases are non‑relational and let you add structure later. - SQL systems typically scale vertically by adding more CPU/Memory, whereas NoSQL platforms scale horizontally by adding additional nodes. - Data in SQL is organized into tables with rows and explicit relationships; NoSQL stores data as flexible documents, key‑value pairs, or graph structures. - Querying SQL relies on a fixed query language and pre‑planned joins, while NoSQL offers more dynamic, schema‑agnostic query capabilities. - SQL excels at handling multi‑row, ACID‑compliant transactions, a strength that many NoSQL solutions do not prioritize. ## Sections - [00:00:00](https://www.youtube.com/watch?v=Q5aTUc7c4jg&t=0s) **SQL vs NoSQL: Core Contrasts** - A brand technical specialist outlines the primary distinctions between SQL and NoSQL databases, covering relational versus non‑relational models, schema planning effort, and the differing vertical versus horizontal scaling approaches. - [00:03:29](https://www.youtube.com/watch?v=Q5aTUc7c4jg&t=209s) **Combining SQL Transactions with NoSQL Flexibility** - The speaker compares structured relational tables with transactional rollbacks to unstructured JSON‑based NoSQL, then suggests a hybrid e‑commerce design where transient session and clickstream data reside in NoSQL while finalized orders are stored in a relational database. ## Full Transcript
0:00Hmm…SQL versus NoSQL? You'll be surprised  to know that this conversation comes up 0:08more than often than you think. Hello, my name is  Jamil Spain, Brand Technical Specialist with the 0:14U.S. Financial Services market. And as you try to  pick a side on how you want to choose to use SQL 0:21or NoSQL databases, I thought it would be great  for me to bring out my top five differences to 0:27really give you the information you want to back  up your decision. So let's get started with this. 0:34When it comes to SQL, we know that this works off  a relational database structure here. Now that 0:42means that you're going to access all your data  points, they have to have some type of relation, 0:47you've got to do a lot of pre-work to kind of  decide out your structure, how they're going 0:51to relate. Whereas on the NoSQL side this is  not relational. So, we really don't have to, 0:58I really feel for a lot of projects. I can go ahead  and get started and deal with a lot of that effort 1:04later on in the process here. As your database  kinda checks, and gets a lot of traffic and needs 1:11to really start to grow, on the infrastructure for  SQL servers they're going to vertically scale. 1:20Okay. Whereas on the NoSQL side these  are going to be horizontal scaling. 1:30All right, um and we know that SQL servers  are going to be backed by this they're going 1:34to need more memory, more computing power to  actually process all these transactions. Whereas 1:40horizontally with NoSQL it's all in memory, I can  keep adding secondary nodes to handle and balance 1:47out a lot of the usage there as well. On the  SQL side when I kind of talk about my structure 1:54it's really going to be always  about table, being table based. 2:01I am super concerned about how  I’m categorizing my entities, my, 2:06my tables into records and how I’m doing my  relationship. So I have to kind of think of a, I like 2:12to say more of a warehouse kind of nature that  I’m collecting all this data here as well. And 2:17we all know from NoSQL it is based on a document  approach. So these are really going to be documents, 2:26all right. They can be key value hashes, this is  great for GraphQL, I mean a lot of the graphs, okay. 2:35It's really meant to not really have any kind  of structure, it's kind of the opposite of being 2:39a table based I can fit pretty much anything  um in this as well. So what about when you want 2:44to access all the data? I’m going to have to use  the SQL query language to actually define all my 2:53queries to pull all my data out so it's kind of  some pre-planning about how I’m going to access 2:58and join my data if I’m going to normalize all the  data there. Where I feel the NoSQL is definitely 3:04much, much more dynamic. All right. I’m really able  to, really just make my collections of these 3:11type of documents no matter what the structure  and then I can have more freedom to let it flow 3:17and how I want to query these items as well. So  lastly SQL great for multi-row transactions. 3:32Where we have our tables, we have a lot of data  that we want to put in, remember the ability to do 3:37the transactions and being able to roll back and  forth so I can really control a lot of what the, 3:44what goes in. On the other side with NoSQL we  remember that this is going to be all unstructured. 3:55Usually it's JSON, it's very great for working  with JSON. Let me make sure I write here on 4:00number four that was also dynamic. 4:05All right. So the unstructured JSON versus something that 4:08is a very planned out, I specifically want to  enter this in as well. So that kind of ends the 4:15features between the two, but actually I can  think of a scenario where this actually is an 4:24"and" that should be here as well. Do we really  have to make a definitive choice of either or? 4:30One of those scenarios goes  to the fact that I can have, 4:33let's say I have a common e-commerce application  which is usually composed of some bit of mobile 4:44and has some interaction with a more of a back-end,  whether it's an API that wants to kind of go 4:51we want to commit a lot of the data. Think about  a shopping cart, okay. Let's kind of visualize 4:56this for a minute. As I make sessions, I browse,  I do all these things, it's more like data in 5:02transient it's not really ready to be committed  yet. So, I could see unstructured session data, 5:08product data, what I clicked on set of clicks all  that stuff could be great for compiling into any 5:16structure into a NoSQL site. And then as I make the  order or the transaction that could be definitely 5:22something that I kick off into my SQL database  back in where I want to facilitate interaction 5:28with different departments, not only is it going  to the shipping department, maybe the marketing, 5:33maybe a couple other subsystems that I want to  document that order has been placed and kick off 5:39a few other work streams. So, this is just  one of many scenarios that you can choose. 5:46I'll be curious to know in the future whether you  pick a side, or you join forces to power your next 5:53application. Thank you for your time. If  you have questions, please drop us a line 5:58below. And if you want to see more videos like  this in the future, please like and subscribe.