Data Modeling hard
In Time Series Databases (like Prometheus/InfluxDB), what is the 'Cardinality Explosion' problem?
- A The physical exhaustion of local disk space caused by storing an excessive number of high-resolution data points per second for a single metric.
- B The creation of too many unique label combinations (e.g., using `user_id` as a tag), which bloats the inverted index and exhausts system memory.
- C A computational failure that occurs when timestamps exceed the 64-bit integer limit, causing the storage engine to incorrectly overwrite historical data.
- D A specialized write-anomaly where data points arriving out of chronological order force the database to perform expensive, recursive re-indexing of the entire shard.
Answer: B. The creation of too many unique label combinations (e.g., using `user_id` as a tag), which bloats the inverted index and exhausts system memory.
In Time Series Databases (TSDBs), every unique set of labels (tags) identifies a distinct time series. If you use high-cardinality data like `Request_ID` or `User_Email` as labels, the number of series can reach millions, causing the 'Inverted Index' (which maps labels to series) to explode in size. This leads to massive RAM consumption and slow query performance, as the system must scan increasingly fragmented indices to aggregate data.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When modeling a Distributed Transaction using the Saga Pattern (Choreography or Orchestration), what type of consistency do you achieve?
- Which practice prevents SQL Injection attacks?
- What is 'Bi-Temporal' data modeling (e.g., in SQL:2011 standard)?
- Adding an Index to a database column generally improves Read performance. What is the negative trade-off?
- Log Systems Merge (LSM) Trees (used in RocksDB, Cassandra) optimize for fast writes. What is their primary downside regarding Disk I/O?
- What is the primary objective of normalizing a relational database schema (e.g., to 3NF)?