Hi, I’m working on a data modeling problem in Star...
# questions-and-troubleshooting
u
Hi, I’m working on a data modeling problem in StarRocks and I’d like some advice. In my use case, each record contains about n × 100 metric keys, and the total dataset size is around 10 million rows. For analytics, I usually filter by a business ID and then aggregate the values of specific keys. Right now, I’m unsure which design is more appropriate: Option 1 — Use a MAP column Store all metrics in a single
MAP<STRING, DOUBLE>
column. This keeps one row per business object, but the MAP can contain hundreds of keys. Option 2 — Use a KV model Normalize the data into a table shaped like:
Copy code
id | key | value
This means one row per key, which could expand to hundreds of millions or even billions of rows. Given this scale and query pattern, which approach is generally better in StarRocks for performance, storage, and analytical efficiency: MAP or KV? Are there best practices or trade-offs I should consider? Thanks in advance for any guidance.
m
JSON would be more effective because it utilizes columnar storage to efficiently prune unnecessary metrics.