4 Architecting IoT Cloud
197
Key 1
Key 2
Key 3
Key 4
Key 5
Value 1
Value 2
Value 3
Value 4
Value 5
Key-value store
Document
{
Person: {
first_name: “Farshad”,
last_name: “Firouzi”,
address: [
{ “type”: “home”,
“city”: “Dusseldorf”, “country”:
“Germany”},
{“type”: “home”,
“city”: “Austin”, “country”: “USA”}
],
}
}
Row
key 1
Name 1:
Value 1
Name 2:
Value 2
Column 1
Column 2
Row
key 2
Name 1:
Value 1
Column 1
Column family 1 Column family 2
Column store
Name:
Krish
Name:
Sani
Name:
Farshad
Knows
Graph
Fig. 4.14 Four different types of NoSQL database
• When Should SQL/NoSQL Be Used?
When choosing which database is most appropriate, it is most important to
determine if a relational (SQL) or non-relational (NoSQL) data structure is needed.
Both offer options; however, there are additional differences between SQL and
NoSQL that must be considered. In general, SQL should be used in the following
scenarios:
• When building custom dashboards
• Analyzes behavior-related or custom sessions
• When you need to store or extract database information quickly
• Preferable when using joins and complex queries
• When you need ACID transaction
• When you know the schema (structure of data) in advance and it does not change
over time
197
Key 1
Key 2
Key 3
Key 4
Key 5
Value 1
Value 2
Value 3
Value 4
Value 5
Key-value store
Document
{
Person: {
first_name: “Farshad”,
last_name: “Firouzi”,
address: [
{ “type”: “home”,
“city”: “Dusseldorf”, “country”:
“Germany”},
{“type”: “home”,
“city”: “Austin”, “country”: “USA”}
],
}
}
Row
key 1
Name 1:
Value 1
Name 2:
Value 2
Column 1
Column 2
Row
key 2
Name 1:
Value 1
Column 1
Column family 1 Column family 2
Column store
Name:
Krish
Name:
Sani
Name:
Farshad
Knows
Graph
Fig. 4.14 Four different types of NoSQL database
• When Should SQL/NoSQL Be Used?
When choosing which database is most appropriate, it is most important to
determine if a relational (SQL) or non-relational (NoSQL) data structure is needed.
Both offer options; however, there are additional differences between SQL and
NoSQL that must be considered. In general, SQL should be used in the following
scenarios:
• When building custom dashboards
• Analyzes behavior-related or custom sessions
• When you need to store or extract database information quickly
• Preferable when using joins and complex queries
• When you need ACID transaction
• When you know the schema (structure of data) in advance and it does not change
over time
