我正在尝试找出哪个数据库更适合在我的情况下存储 JSON 类型数据。假设我在某个时候有这些数据:
[
{
"parent_name": "A",
"versions": [
{
"version": "1.1",
"dependencies": [
{
"dep_name": "B",
"version": "5.2"
},
{
"dep_name": "C",
"version": "9.7"
}
]
}
]
}
]
一次更新后,我得到了这样的信息:
[
{
"parent_name": "A",
"versions": [
{
"version": "1.1",
"dependencies": [
{
"dep_name": "B",
"version": "5.2"
},
{
"dep_name": "C",
"version": "9.7"
}
]
},
{
"version": "1.2",
"dependencies": [
{
"dep_name": "D",
"version": "3.9"
}
]
}
]
}
]
又一个:
[
{
"parent_name": "A",
"versions": [
{
"version": "1.1",
"dependencies": [
{
"dep_name": "B",
"version": "5.2"
},
{
"dep_name": "C",
"version": "9.7"
}
]
},
{
"version": "1.2",
"dependencies": [
{
"dep_name": "D",
"version": "3.9"
},
{
"dep_name": "E",
"version": "20.8"
}
]
}
]
}
]
也许又一个:
[
{
"parent_name": "A",
"versions": [
{
"version": "1.1",
"dependencies": [
{
"dep_name": "B",
"version": "5.2"
},
{
"dep_name": "C",
"version": "9.7"
}
]
},
{
"version": "1.2",
"dependencies": [
{
"dep_name": "D",
"version": "3.9"
},
{
"dep_name": "E",
"version": "20.8"
}
]
}
]
},
{
"parent_name": "X",
"versions": [
{
"version": "0.2",
"dependencies": [
{
"dep_name": "A",
"version": "1.2"
}
]
}
]
}
]
我正在用 Python 编写脚本。我很困惑对于这种特定情况应该选择 SQL 还是 NoSQL 类型数据库。你能告诉我你的想法吗?