What: kind of json is expected in Capacity Estimation tool of Cosmos DB
With Cosmos DB intent of the designers is to help developers and DBA focus on domain thus bringing the SLAs for low latency, throughput, consistency and availability all with underlying powerful global distribution available on tap.
The performance, throughput SLAs require defining required throughput. This throughput can be estimated using capacity estimation tool.
This tool requires a json document which represents one unit of entity that will be stored or retrieved. So an array like below will not work —
[
{ “_id”:{ “$oid”:”5968dd23fc13ae04d9000001"},
“product_name”:” citrate”,
“supplier”:”TEN”,“quantity”:261,
“unit_cost”:”$10.47"},
{“_id”:{“$oid”:”5968dd23fc13ae04d9000002"},
“product_name”:” ashei”,
“supplier”:”XYZ”,“quantity”:292,
“unit_cost”:”$8.74"},
{“_id”:{“$oid”:”5968dd23fc13ae04d9000003"},
“product_name”:” HBr”,
“supplier”:”ABC”,
“quantity”:211,“unit_cost”:”$20.53"}
]
If you plan to store array like this — you need to convert this into full fledged json of that entity.
{ "o" :
[
{ “_id”:{ “$oid”:”5968dd23fc13ae04d9000001"},
“product_name”:” citrate”,
“supplier”:”TEN”,“quantity”:261,
“unit_cost”:”$10.47"},
{“_id”:{“$oid”:”5968dd23fc13ae04d9000002"},
“product_name”:” ashei”,
“supplier”:”XYZ”,“quantity”:292,
“unit_cost”:”$8.74"},
{“_id”:{“$oid”:”5968dd23fc13ae04d9000003"},
“product_name”:” HBr”,
“supplier”:”ABC”,
“quantity”:211,“unit_cost”:”$20.53"}
]
}
Or otherwise if intent was to store individual document — for each product — just use that.