DEV Community

Run of Queries in Amazon Timestream Database for LiveAnalytics

“ I have checked the documents of AWS to run the queries in amazon timestream database for liveanalytics. Amazon timestream service provides a query editor where we can directly select the database and table created in timestream db and be able to run the queries in it. Pricing of the solution depends on usage of timesteam db, s3 bucket and sns service.”

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. Timestream for LiveAnalytics saves you time and cost in managing the lifecycle of time series data by keeping recent data in memory and moving data to a cost optimized storage tier based upon user defined policies.

Timestream for LiveAnalytics' built query engine lets you access and analyze recent and data together, without having to specify its location. It built in time series analytics functions, helping you identify trends and patterns in your data in near real time. It is serverless and automatically scales up or down to adjust capacity and performance. Because you don't need to manage the underlying infrastructure, you can focus on optimizing and building your applications.

In this post, you will get to know how to run the queries in amazon timestream database for liveanalytics. Here I have used a sns topic and s3 bucket.

Prerequisites

You’ll need an Amazon SNS for this post. Getting started with amazon SNS provides instructions on how to create a topic and subscription. For this blog, I assume that I have a sns topic created.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, amazon timestream, sns topic, s3 bucket, query editor and mail box.

Solution overview

The blog post consists of the following phases:

  1. Create Database in Amazon Timestream for LiveAnalytics
  2. Create Database and Table with Custom Options
  3. Schedule of Query for Database and Table with SNS Notification

I have sns topic with subscription as below →
Image description

Phase 1: Create Database in Amazon Timestream for LiveAnalytics

  1. Open the Timestream console and create a database with configurations as sample database named “TestDB”, datasets as IOT and DevOps, multi-measure records option. Also test the sample database with sample queries in query editor.

Image description

Image description

Image description

Image description

Image description

Image description

Phase 2: Create Database and Table with Custom Options

  1. In timestream, create a database as a standard database with aws managed encryption option. Also create a table with a custom partition key and data retention option. Also test of database and table in query editor with run of query.

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Phase 3: Schedule of Query for Database and Table with SNS Notification

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Clean-up

Delete SNS Topic, S3 Bucket and Timestream.

Pricing

I review the pricing and estimated cost of this example.

Cost of Simple Notification Service = Free for notifications and requests = $0.0

Cost of Amazon Timestream = $0.0

Cost of S3 = $0.25

Total Cost = $0.25

Summary

In this post, I showed “how to run the queries in amazon timestream database for liveanalytics”.

For more details on Amazon Timestream, Checkout Get started Amazon Timestream, open the Amazon Timestream console. To learn more, read the Amazon Timestream documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

Top comments (0)