Amazon Timestream for LiveAnalyticsとは
時系列データを保存・分析するためのフルマネージド・サーバーレスなデータベースサービス
出典: What is Amazon Timestream for LiveAnalytics?
“Amazon Timestream for LiveAnalytics is a fast, scalable, fully managed, purpose-built time series database that makes it easy to store and analyze trillions of time series data points per day.”
時系列データとは
時間の経過とともに記録されるデータポイントの連続。例:
- IoTセンサーの温度・湿度
- サーバーのCPU使用率
- 株価の推移
- アプリケーションのメトリクス
主な特徴
サーバーレス・自動スケーリング
出典: What is Amazon Timestream for LiveAnalytics?
“With Amazon Timestream for LiveAnalytics, there are no servers to manage and no capacity to provision. As the needs of your application change, Timestream for LiveAnalytics automatically scales to adjust capacity.”
2層ストレージとデータライフサイクル管理
Timestreamは2つのストレージ層を持ち、データの鮮度に応じて自動的に移動させる
出典: Storage
“Timestream for Live Analytics stores and organizes your time series data to optimize query processing time and to reduce storage costs. It offers data storage tiering and supports two storage tiers: a memory store and a magnetic store.”
メモリストア
最新データを保持する高速ストレージ。リアルタイムのデータ書き込みと高速なポイントインタイムクエリに最適化されている
出典: Storage
“The memory store is optimized for high throughput data writes and fast point-in-time queries.”
- 保持期間: 1時間〜8,766時間(約1年)
- 用途: 直近のデータへの高速アクセス、リアルタイム監視
マグネティックストア
履歴データを保持する低コストストレージ。長期保存と分析クエリに最適化されている
出典: Storage
“The magnetic store is optimized for lower throughput late-arriving data writes, long term data storage, and fast analytical queries.”
- 保持期間: 1日〜73,000日(約200年)
- 用途: 長期トレンド分析、履歴データの保存
データの流れ
データ書き込み → メモリストア(例: 1週間保持)
↓ 保持期間経過
マグネティックストア(例: 1年保持)
↓ 保持期間経過
自動削除
出典: Storage
“For example, consider a scenario where you configure the memory store to hold a week’s-worth of data and the magnetic store to hold 1 year’s-worth of data. The age of the data is computed using the timestamp associated with the data point. When the data in the memory store becomes a week old it is automatically moved to the magnetic store. It is then retained in the magnetic store for a year. When the data becomes a year old, it is deleted from Timestream for Live Analytics.”
常時暗号化
出典: What is Amazon Timestream for LiveAnalytics?
“Amazon Timestream for LiveAnalytics ensures that your time series data is always encrypted, whether at rest or in transit.”
高可用性
出典: What is Amazon Timestream for LiveAnalytics?
“Amazon Timestream ensures high availability of your write and read requests by automatically replicating data and allocating resources across at least 3 different Availability Zones within a single AWS Region.”
アーキテクチャ
データ取り込み ストレージ 分析・可視化
───────────── ───────── ──────────
IoT Core ─┐ ┌─────────────┐
Kinesis ─┼→ Timestream → │メモリストア │→ SQL分析
MSK ─┤ for │(最新データ)│ ↓
Telegraf ─┘ LiveAnalytics└──────┬──────┘ Grafana
自動移行↓ QuickSight
┌──────────────┐ SageMaker
│マグネティック│
│ストア(履歴)│
└──────────────┘
バッチ書き込み(Batching Writes)
WriteRecords APIを使って、複数のデータポイントを1回のリクエストでまとめて書き込む機能
出典: Batching writes with WriteRecords API
“Amazon Timestream for Live Analytics enables you to write data points from a single time series and/or data points from many series in a single write request. Batching multiple data points in a single write operation is beneficial from a performance and cost perspective.”
具体例
100台のIoTデバイスが毎秒センサーデータを送信するケースを考える
バッチなし(1件ずつ書き込み):
WriteRecords(device-1のデータ) → 1リクエスト
WriteRecords(device-2のデータ) → 1リクエスト
WriteRecords(device-3のデータ) → 1リクエスト
...
WriteRecords(device-100のデータ) → 1リクエスト
─────────────────────────────────
合計: 100リクエスト/秒
バッチあり(まとめて書き込み):
WriteRecords([
device-1のデータ,
device-2のデータ,
...
device-100のデータ
]) → 1リクエスト
─────────────────────────────────
合計: 1リクエスト/秒
マルチメジャーレコード(Multi-measure Records)
1つのテーブル行に複数のメジャー(測定値)を格納する機能
出典: Writes - Multi-measure records
“With multi-measure records, you can store your time-series data in a more compact format in the memory and magnetic store, which helps lower data storage costs. Also, the compact data storage lends itself to writing simpler queries for data retrieval, improves query performance, and lowers the cost of queries.”
シングルメジャー vs マルチメジャー
シングルメジャーレコード(従来方式):
timestamp | device_id | measure_name | measure_value
─────────────┼───────────┼──────────────┼──────────────
2026-02-13 | device-1 | cpu_usage | 75.5
2026-02-13 | device-1 | memory_usage | 60.2
2026-02-13 | device-1 | disk_io | 120
→ 同じタイムスタンプで3行必要
マルチメジャーレコード:
timestamp | device_id | cpu_usage | memory_usage | disk_io
─────────────┼───────────┼───────────┼──────────────┼─────────
2026-02-13 | device-1 | 75.5 | 60.2 | 120
→ 1行で済む