What is Riak TS?
Before we install Riak TS, we’ll take a few minutes to explain what time series data is and what Riak TS provides. If you’re already familiar with those topics, you may skip ahead to the next module.
What is Riak TS?
Officially, Riak TS is a distributed, extensible, and scalable NoSQL key/value database optimized to store, query, and analyze massive amounts of time-sequenced data. Whew! That’s a mouthful. Let’s breakdown what that means.
We’ll start with the end and work back. Riak TS is “optimized to store, query, and analyze massive amounts of time-sequenced data”. Time series simply means information that is part of a time-based sequence. It can be anything from commodity prices to health information to wind speed measurements. For instance, you can imagine wind speed measurements like:
- 8:00am, 5mph
- 8:05am, 0mph
- 8:10am, 2mph
In the above example, you may be reading data from a single source. What if you need to concurrently process data from many sources (e.g. IoT devices, sensors, monitors, etc.)? Not a problem. Riak TS was designed to allow you to efficiently track such activity from many sources.
One of Riak TS’s optimizations that supports time series data is data locality. For now, all you need to know is that Riak TS allows you to store data in a highly efficient way for very fast responses based upon how you intend to query. It’s simple to use because you only need to focus on setting up your table, and Riak TS does the rest!
We also said that Riak TS is a “distributed, extensible, and scalable NoSQL key/value database”. One of the great things about Riak TS is that it was built upon the battle-tested and proven Riak KV (key/value) data store. With this incredibly powerful and stable foundation, Riak TS inherits those desirable properties of being “distributed, extensible and scalable”. Specifically, Riak TS enjoys:
- Fault-tolerance from a masterless, clustered design
- Increased resiliency and load distribution by processing read and write requests on any node
- Horizontal scalability whether using commodity hardware or cloud services
On top of it all, it’s simple to operate and open-source. So now that you know what Riak TS is, let’s discuss a few its advantages.
What are the biggest benefits of Riak TS?
First and foremost, Riak TS is all about making it easy to store and query time series data! What is time series data? The common characteristic is that the data is part of a time-based sequence of data points or, in other words, a time series. It’s true that you can store time series data in a data store that was not purposefully built for time series. However, to get the most value out of this data you need to be able to identify and analyze trends. As you’ll see in future lessons, Riak TS provides powerful tools to do just that.
What features are available in Riak TS?
Riak TS is a rapidly advancing project with new features coming in each release. A few of our current features include:
- Write-once optimized PUT path. This optimization is specifically for data meant to be written exactly once and never updated or overwritten (think of the wind speed example above). For use cases that follow the write-once pattern, this optimization results in the ability to handle huge write traffic (think 1000s of devices at high frequency).
- With user-configurable data locality (which, as we talked about above, gives you the option to organize your data to best suit the queries you want to run), your reads will also be optimized.
- You may very well already know SQL. To make your life as easy as possible, Riak TS uses an extended subset of SQL for creating tables, inserting data, and range queries. As you go through the lessons, you’ll see what SQL statements to use for various TS operations. They should be pretty familiar.
- Riak shell provides a way for you to run basic TS commands and basic SQL commands from a single place.
With robust clients for Python, Erlang, Java, Ruby, .NET and Node.js Riak TS makes it easy for you to build time-based applications in a language or framework that you are already comfortable and proficient in.
Those are just a few highlights of all that Riak TS offers today, with more coming out in each new release. But what can you use it for? We mentioned earlier that it is specifically designed for time series data, which you’ll remember is data in a time-based sequence. We previously gave an example of weather data. Let’s take a look at a more specific example.
Great, but what do I do with Riak TS?
Let’s say you are hired to monitor transformer performance for a local power company. You need to find a way to track temperature and current flow readings from the sensors at different substations. You’ll need this data to determine the health and power consumption of each transformer so you can report it to your boss.
You’ll use Riak TS to create a table designed to store incoming information from each sensor, including: the substation ID, transformer ID, time, temperature, and current. You’ll then query the table to find the trend of a transformer’s temperature by determining its average temperature per hour.
Sounds cool, right? In the other courses, you’ll learn how to use the various features of Riak TS to help you as you work at the power company.
Now that you know the benefits, features, and ways that Riak TS can be used, you are ready to install and start using it.
Do you have questions, comments, suggestions, or just want to chat about topics related to Basho Academy? If so, please drop by our community forums and say hello.