Amazon Timestream

A serverless time series database — built for data that arrives stamped with a time, is only ever appended, and is queried "over a window" rather than by primary key. Sensor readings, metrics, clickstreams. Trillions of events a day, and it tiers old data to cheap storage on its own.

Một time series database serverless — sinh ra cho loại dữ liệu luôn gắn mốc thời gian, chỉ ghi thêm chứ không sửa, và được query "theo khoảng thời gian" chứ không tra theo primary key. Số đo cảm biến, metric, clickstream. Hàng nghìn tỉ event mỗi ngày, tự chuyển data cũ xuống storage rẻ.

Reach for itNên dùng

  • IoT fleets — thousands of devices each emitting readings every few secondsĐội thiết bị IoT — hàng nghìn device, vài giây lại gửi số đo
  • Application / infrastructure metrics you want to keep far longer than a monitoring tool's retentionMetric ứng dụng / hạ tầng muốn giữ lâu hơn nhiều so với retention của công cụ monitoring
  • Queries shaped like "average per 5 minutes over the last 30 days, per device"Query dạng "trung bình mỗi 5 phút trong 30 ngày qua, theo từng device"
  • The volume has outgrown a relational table and the index maintenance is hurtingKhối lượng đã vượt sức một bảng quan hệ và việc duy trì index bắt đầu đau

Not the right toolKhông hợp

  • Records that get updated or deleted individually → DynamoDB / RDSBản ghi bị update hoặc delete riêng lẻ → DynamoDB / RDS
  • Joins across business entities, reporting on dimensions → RedshiftJoin giữa các thực thể nghiệp vụ, báo cáo theo chiều → Redshift
  • Short-term operational monitoring with alarms → CloudWatch metricsMonitoring vận hành ngắn hạn kèm alarm → CloudWatch metrics
  • Log lines you want to search by text → OpenSearchDòng log muốn tìm theo text → OpenSearch

1 · What "time series" means1 · "Time series" nghĩa là gì

A time series is a sequence of measurements, each stamped with the moment it was taken. Two properties make it its own kind of database problem: records are only ever appended (you don't go back and edit yesterday's temperature), and queries ask about a window of time ("max per hour, last 7 days") instead of fetching one row by key. A relational table can hold this, but the index churn and the scan cost grow brutal at billions of rows. Time series là một chuỗi các phép đo, mỗi phép đo gắn với thời điểm đo. Hai tính chất khiến nó thành bài toán database riêng: bản ghi chỉ được ghi thêm (không ai quay lại sửa nhiệt độ của hôm qua), và query hỏi theo một khoảng thời gian ("max mỗi giờ, 7 ngày qua") chứ không lấy một row theo key. Bảng quan hệ vẫn chứa được, nhưng chi phí index và scan trở nên tàn khốc ở mức hàng tỉ dòng.

A Timestream record has a timestamp, dimensions that identify the source, and one or more measures — plotted over time it forms a series one record time 2026-07-25T09:00:00Z dimensions device = sensor-42 region = eu-west-1 → who emitted it measures temp = 21.5 · rh = 48 the same measure over time append only · never updated

Dimensions say who the reading came from, measures are the numbers. Put many records side by side and you have the series on the right.

Dimension cho biết số đo đến từ đâu, measure là con số. Xếp nhiều record cạnh nhau là ra chuỗi bên phải.

  • Multi-measure records — put temperature, humidity and pressure in one record instead of three separate ones. Fewer records means less storage, cheaper writes and faster queries; use them by default.Multi-measure record — bỏ nhiệt độ, độ ẩm, áp suất vào một record thay vì ba record riêng. Ít record hơn = ít storage, ghi rẻ hơn, query nhanh hơn; nên dùng mặc định.
  • Scheduled queries — a query that runs on a schedule and writes its result into another table. Use it to pre-compute rollups (hourly averages) so dashboards read a small table instead of scanning raw points.Scheduled query — một query chạy theo lịch và ghi kết quả vào bảng khác. Dùng để tính sẵn rollup (trung bình theo giờ) để dashboard đọc bảng nhỏ thay vì scan điểm thô.
  • Built-in time series analytics functions — interpolation (fill gaps where a sensor missed a reading), smoothing, derivatives. These are the "identify patterns in near real-time" tools, and they'd be painful to write by hand in plain SQL.Hàm phân tích time series có sẵn — nội suy (lấp chỗ trống khi cảm biến bỏ lỡ một lần đo), làm mượt, đạo hàm. Đây là bộ công cụ "nhận diện pattern gần real-time", tự viết bằng SQL thuần thì rất cực.
  • SQL compatibility means existing tools and people connect without learning a new query language.Tương thích SQL nghĩa là công cụ và con người sẵn có kết nối được ngay, không phải học ngôn ngữ query mới.

2 · Storage tiering2 · Phân tầng storage

Recent data lands in the in-memory tier and ages automatically into cost-optimised storage; a single SQL query reads across both tiers writes Memory store recent data · fast writes point-in-time lookups ages out automatically Cost-optimised store historical data analytical scans then expires one SQL query reads across both tiers

You set two retention windows — how long data stays in memory, and how long it survives in the cheap tier. Everything after that is automatic.

Bạn chỉ đặt hai mốc retention — data nằm trong memory bao lâu, và sống trong tầng rẻ bao lâu. Phần còn lại tự động hết.

  • Data storage tiering: recent data kept in memory, historical data kept in cost-optimised storage. You never move data by hand.Phân tầng lưu trữ: data mới giữ trong memory, data cũ giữ ở storage tối ưu chi phí. Không bao giờ phải tự tay chuyển data.
  • The memory tier is what makes writes and recent-window queries fast; the cheap tier is what makes keeping years of history affordable.Tầng memory là thứ làm việc ghi và query khoảng gần đây nhanh; tầng rẻ là thứ khiến giữ nhiều năm lịch sử vẫn kham được.
  • Queries don't care which tier the data is in — that's the point of the design.Query không cần biết data nằm ở tầng nào — đó chính là ý đồ thiết kế.
  • Encryption in transit and at rest is on by default.Mã hoá khi truyền và khi lưu bật sẵn.

3 · Architecture — what feeds it, what reads it3 · Kiến trúc — cái gì đổ vào, cái gì đọc ra

Timestream ingests from AWS IoT, Kinesis via Lambda, Prometheus, Telegraf and Managed Flink; QuickSight, SageMaker, Grafana and JDBC clients read from it INGEST CONSUME AWS IoT Kinesis Data Streams Prometheus Telegraf KDS · MSK Lambda Managed Flink Timestream serverless QuickSight SageMaker Grafana any JDBC client agents and streams write in · dashboards, notebooks and SQL clients read out

Devices and agents can write straight in; anything already on a stream goes through Lambda (simple) or Managed Flink (windowing / enrichment first).

Thiết bị và agent ghi thẳng vào; thứ gì đã nằm trên stream thì đi qua Lambda (đơn giản) hoặc Managed Flink (cần cửa sổ thời gian / làm giàu dữ liệu trước).

  • AWS IoT can route device messages into Timestream with a rule — no code between the device and the table.AWS IoT có thể route message thiết bị thẳng vào Timestream bằng một rule — không cần code giữa thiết bị và bảng.
  • Telegraf is an open-source metrics-collection agent you run on a host; Prometheus is the open-source monitoring system that scrapes metrics from your services. Both can ship their data to Timestream, which is how existing monitoring stacks get long-term storage.Telegraf là agent thu thập metric mã nguồn mở chạy trên máy chủ; Prometheus là hệ monitoring mã nguồn mở đi "scrape" metric từ các service. Cả hai đều đẩy được data sang Timestream — đó là cách stack monitoring sẵn có có được kho lưu trữ dài hạn.
  • Streaming sources arrive via Lambda (per-record transform) or Managed Apache Flink (aggregate over a time window before writing).Nguồn streaming vào qua Lambda (biến đổi từng record) hoặc Managed Apache Flink (gộp theo cửa sổ thời gian trước khi ghi).
  • On the read side: QuickSight and Grafana (an open-source dashboard tool for time series) for charts, SageMaker for models, and any JDBC client for plain SQL.Phía đọc: QuickSight và Grafana (công cụ dashboard mã nguồn mở cho time series) để vẽ biểu đồ, SageMaker để làm model, và bất kỳ client JDBC nào để chạy SQL.

Exam reflexesPhản xạ khi thi

  • The words "IoT sensor data", "time series" or "trillions of events per day" in a question → Timestream.Đề có chữ "data cảm biến IoT", "time series" hay "hàng nghìn tỉ event mỗi ngày" → Timestream.
  • "Keep recent data fast but archive years of history cheaply" → that's storage tiering, already built in. No lifecycle policy to design."Giữ data mới cho nhanh nhưng lưu trữ nhiều năm lịch sử cho rẻ" → chính là storage tiering, có sẵn. Không phải thiết kế lifecycle policy nào.
  • "Our RDS table of metrics has become unmanageable" → migrate to Timestream; the cost/performance claim is the point of the service."Bảng metric trên RDS đã không quản nổi" → chuyển sang Timestream; đó chính là lý do dịch vụ này tồn tại.
  • "Pre-compute hourly rollups for a dashboard" → scheduled query writing into a second table."Tính sẵn rollup theo giờ cho dashboard" → scheduled query ghi vào bảng thứ hai.
  • "We need to update or delete individual readings" → wrong tool. Time series is append-only by design."Cần update hoặc xoá từng số đo riêng lẻ" → sai công cụ. Time series vốn thiết kế chỉ để ghi thêm.