Amazon Timestream

A purpose-built time-series database service that rapidly ingests and queries IoT sensor data and application metrics, with automatic data lifecycle management

Overview

Amazon Timestream is a fully managed database service purpose-built for time-series data. It efficiently stores and queries timestamped data such as IoT device sensor readings, application metrics, and infrastructure monitoring data. Its two-tier architecture of memory store and magnetic store automatically migrates recent data from the high-speed memory store to the low-cost magnetic store as it ages. A SQL-compatible query language supports time-series functions including interpolation, smoothing, and approximation.

Two-Tier Storage Architecture and Data Lifecycle

Timestream's defining feature is its automatic data lifecycle management through a two-tier structure of memory store and magnetic store. The memory store holds recent data (hot data) and is optimized for writes and queries on recent data. Its retention period is configurable from 1 hour to 8,766 hours (approximately 1 year). The magnetic store holds historical data (cold data) at roughly 1/10 the cost of the memory store, suited for long-term retention. Its retention period is configurable from 1 day to 73,000 days (approximately 200 years). Data exceeding the memory store's retention period is automatically migrated to the magnetic store with no user intervention required. Queries transparently search both stores, so applications don't need to be aware of the difference. A common production configuration sets the memory store retention to 24 hours for real-time dashboards and the magnetic store retention to 1 year for long-term trend analysis.

Comparison with RDB and DynamoDB for Time-Series Data

When managing time-series data in an RDB (RDS/Aurora), you create indexes on timestamp columns to speed up time-range queries, but once data exceeds hundreds of millions of rows, index maintenance costs grow and write performance degrades. Partitioning can help, but you must implement partition management and automatic data deletion yourself. With DynamoDB, the common pattern uses device ID as the partition key and timestamp as the sort key, but time-series-specific aggregate functions (moving averages, interpolation, downsampling) must be implemented in the application layer. Timestream solves these challenges with a purpose-built engine. Writes handle millions of records per second with no performance degradation as data volume grows. Time-series functions are built into SQL, including INTERPOLATE_LINEAR, INTERPOLATE_SPLINE, and bin() for time-bucket aggregation. Compared to open-source time-series databases like InfluxDB and TimescaleDB, Timestream requires no infrastructure management and has built-in automatic storage tiering. On the other hand, it lacks the expressive power of InfluxDB's Flux language for complex time-series transformations.

IoT Data Pipeline and Grafana Integration Design

Timestream's typical data pipeline follows the pattern: IoT devices ->IoT Core -> IoT Core rules -> Timestream. IoT Core rule actions support direct writes to Timestream tables without going through Lambda. For high-frequency data from large device fleets, IoT Core rules process thousands of messages per second, and Timestream's batch write API stores them efficiently. For application metrics, common patterns include Kinesis Data Streams -> Lambda -> Timestream, or Telegraf (an open-source metrics collection agent) -> Timestream. For visualization, Amazon Managed Grafana integration is the most practical option. An official Grafana data source plugin for Timestream lets you write SQL queries directly in Grafana dashboard panels. You can build time-series graphs, heatmaps, and alert configurations in Grafana's UI to visualize Timestream data in real time. QuickSight can also connect to Timestream, but Grafana offers superior expressiveness for time-series visualization. Pricing consists of four components: writes (approximately 0.50 USD per million 1 KB records), memory store (approximately 0.036 USD per GB per hour), magnetic store (approximately 0.03 USD per GB per month), and queries (approximately 0.01 USD per GB scanned).

共有するXB!