Choosing a Database for Metric Collection Systems
Time-series database choices for high-ingest metric collection systems.
A metric collection system is fundamentally a time-series system. Every write records a value, a timestamp, and a set of labels such as host, region, service, or HTTP status. That shape matters because it creates a workload that is very different from ordinary transactional software. Writes are frequent, reads are bursty, and retention rules often change over time.
The first design question is not brand selection. It is access pattern. Metrics arrive continuously from agents, applications, and infrastructure. A single service might emit CPU, memory, queue depth, latency histograms, and error counts every few seconds across hundreds of instances. That means the database must absorb a steady write stream with predictable latency. At the same time, dashboards and alert evaluators generate fan-out reads. A human opening a dashboard may request dozens of time windows and aggregations at once. An alert engine may scan thousands of series every minute.
Time-series databases are built for this exact pattern. They store points ordered by time, compress neighbouring samples efficiently, and expose operations such as roll-ups, moving windows, percentile queries, and retention policies as first-class features. They also tend to separate raw ingestion from query optimisation by downsampling old data. Recent data might stay at one-second resolution for fast incident response, while older data is compacted into one-minute or five-minute buckets for long-term trends.
A general-purpose relational database can store metrics, but it usually becomes expensive to operate at scale. High-cardinality labels create index pressure. Windowed aggregations become harder to express and tune. Constant inserts compete with read queries for buffer cache, disk bandwidth, and maintenance work such as vacuuming or index updates. You can make it work for small installations, but you are fighting the storage engine rather than using it as intended.
Wide-column stores such as Cassandra or Bigtable are more plausible because they handle large append-heavy workloads well. The tradeoff is that the schema design becomes your responsibility. You must decide partition keys, bucketing strategy, compaction behaviour, and query shapes up front. If you get label cardinality or time bucketing wrong, hotspots and slow scans appear quickly. That is why teams often prefer an off-the-shelf time-series database unless they have very specific scale or control requirements.
When evaluating options, check five things carefully. First, ingest path: can it handle write bursts without dropping samples? Second, query model: does it support the aggregations your dashboards and alerting rules actually need? Third, cardinality management: what happens when labels explode because someone adds user_id or request_path? Fourth, lifecycle management: can you enforce retention, tiering, and downsampling without building side jobs? Fifth, operations: how difficult is sharding, backup, repair, and upgrade?
The best database for metrics is usually the one that treats time, compression, retention, and label-based querying as core features rather than afterthoughts. Metrics systems look simple at first because each record is tiny. They become difficult when millions of tiny records arrive continuously and operators still expect fast queries during an outage. Choose for that moment, not for the happy-path demo.