August 17, 2023

AWS Timestream — Introduction

The best time to establish protocols with your clients is when you onboard them.

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

When working on Serverless IoT platforms with event sources or scripts that collect analytics data, running into data storage issues? If so, Time-series databases are something we can look into. These databases maintain a collection of data points gathered over a period of time that enables us to monitor changes over milliseconds, days or even years.

As a time-series database, AWS Timestream is comparable to Graphite and Influx. Where inserting events based records are easy but changing your data is typically not done here.

Key Concepts

  • Dimensions — It represents the metadata of the event. Dimensions must be “VARCHAR”. For example if we need to run analytics on basis of user-click points in some page we can have pageName, X coordinates and Y coordinates as dimensions.
  • Measure — Measure is the actual data point we can group-by or measure. Valid types of measure:value is DOUBLE, BIGINT, VARCHAR, BOOLEAN. Based on above mentioned scenario we can assign measure value of “1” for every click against dimensions [ pageName, X cords, Y cords ].
  • Time — Time the event occurred, it is the key sorting point in time-series databases do. Each event must be timestamped.

Traits Of AWS Timestream

  • Serverless auto-scaling — With its fully decoupled design, Amazon Timestream can scale independently for data ingestion, storage, and query, meeting the needs of an application.
  • Storage Tier — With In-Memory Store and Magnetic Store, Amazon Timestream makes managing the data lifecycle simpler. While the In-Memory store is designed for rapid point-in-time queries, the magnetic store is constructed for rapid analytic queries. It is simple to design data retention policies to move data from the memory store to the magnetic store and to delete data from the magnetic store once it reaches a certain age.
  • Time-series Analytics — Amazon Timestream offers time series analytics capability, and time series is a native data type. Support is provided for sophisticated aggregates, window functions, and complex data types including arrays and rows.
  • Adaptive query Engine — A single SQL statement can be used to access data from several storage tiers using Amazon Timestream’s adaptive query engine. It accesses and mixes data across storage tiers discreetly and without the need to specify the location of the data.
  • Encryption — Everything is encrypted in Timestream.

Timestream Pricing

Timestream pricing boils down to two questions:

  • Do you require a long-term memory store?
  • Do you often query a table?

Based on the following dimensions, Amazon Timestream Pricing is calculated

  • Writes: The quantity of data (rounded to the closest KB) that was written from the applications into a table.
  • Queries: The volume of information scanned by the serverless distributed query engine used by Amazon Timestream to produce search results (rounded to the nearest MB, with a 10 MB minimum).

Let’s try something with Js and Timestream

Writing in Timestream: Let’s say user has clicked on (200,485) coordinates now we will write these data.


Querying Timestream: After accumulating some data lets Query with Homepage as pageName.

In a Nutshell

AWS Timestream is a powerful and useful service for anyone working with large amounts of time-series data. Whether you’re looking to store, analyze, or visualise your data, this service can help you do it quickly and easily, so you can focus on building great applications and solutions.

To conclude, Time-series databases are built for aggregating data, based on time intervals for analytics. We will be covering advanced queries and use cases in the next part of the Timestream Blog.

CodeStax.Ai
Profile
August 17, 2023
-
6
min read
Subscribe to our newsletter
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Share this article:

More articles