

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Null Values
incomplete
2: Constraints
incomplete
3: Primary Keys
incomplete
4: Foreign Keys
incomplete
5: Schema
incomplete
6: Relational Databases
incomplete
7: Relational vs. Non-Relational DBs
incomplete
This lesson's interactive features are locked, please to keep using them
The big difference between relational and non-relational databases is that non-relational databases tend to nest their data. Instead of always keeping records in separate tables, they often store records within other records.
To over-simplify it, you can think of non-relational databases as giant JSON blobs. If a user can have multiple courses, you might just add all the courses to the user record.
{
"users": [
{
"id": 0,
"name": "Elon",
"courses": [
{
"name": "Biology",
"id": 0
}
]
},
{
"id": 1,
"name": "Curly",
"courses": [
{
"name": "Biology",
"id": 0
}
]
}
]
}
This often results in duplicate data within the database. That's obviously less than ideal, but it does have some benefits that we'll talk about later in the course.