Logo

dev-resources.site

for different kinds of informations.

ReductStore v1.13.0 Released With New Conditional Query API

Published at
12/6/2024
Categories
news
database
reductstore
Author
atimin
Categories
3 categories in total
news
open
database
open
reductstore
open
Author
6 person written this
atimin
open
ReductStore v1.13.0 Released With New Conditional Query API

We are pleased to announce the release of the latest minor version of ReductStore, 1.13.0. ReductStore is a time series database designed for storing and managing large amounts of blob data.

To download the latest released version, please visit our Download Page.

What's new in 1.13.0?​

This release introduces a new conditional query API that should significantly improve your experience when querying or removing records. The new conditional queries allow you to use logical and comparison operators to filter records by labels. Previously, you could only filter records by labels using the include and exclude options, which were limited to exact matches. This means that you had to classify your records in advance at the ingest stage to be able to filter them later. Now, all you have to do is label your records with metric labels and then use the conditional queries to filter them by any condition you want.

Conditional Query Syntax​

The conditional query syntax is inspired by the MongoDB query language and is based on the JSON format. The query consists of a set of conditions that are combined using logical operators. It can be written in simple object notation:

{ "&label_name": { "$gt": 10 }}
Enter fullscreen mode Exit fullscreen mode

Or in array notation:

{ 
  "$any_of": [
    { "&label_name": { "$gt": 10 } }, 
    { "&label_name": { "$lt": 20 } }, 
    { "&label_name": { "$eq": 15 } }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Here we refer to labels with the & symbol followed by the label name. All operators start with the $ symbol followed by the operator name. Constant values are just JSON values. And that's it! You don't have to learn a new query language to start using conditional queries.

The current version of the Conditional Query API supports all the logical and comparison operators you need to filter records by labels. For a complete list of supported operators, see the Comparison Operators and Logical Operators sections of the documentation.

Real-world Example​

But why do you need to use conditional queries? Let's look at a real-world example. Suppose you collect raw vibration data from a machine and store it in ReductStore. You can calculate the vibration metrics, such as RMS and crest factor, and store them as labels. Now you can use the conditional queries to filter the records by the vibration metrics. For example, we know that when the machine is working, the RMS must be greater than 10, and some problems with the engine happen when the crest factor is greater than 2.5. You can write the following conditional query to get the raw data for detailed analysis:

{ "&rms": { "$gt": 10 }, "&crest_factor": { "$lt": 2.5 }}
Enter fullscreen mode Exit fullscreen mode

With our Python SDK, the conditional query can be used like this:


import time
import asyncio
from reduct import Client, Bucket

async def main():
    # Create a client instance, then get or create a bucket
    async with Client("http://127.0.0.1:8383", api_token="my-token") as client:
        bucket: Bucket = await client.get_bucket("vibration")

        # Query vibration data with RMS > 10 and crest factor < 2.5
        async for record in bucket.query(
                "sensor-1",
                when={
                    "&rms": {"$gt": 10},
                    "&crest_factor": {"$lt": 2.5}
                },
        ):

            _raw_data = await record.read_all()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Enter fullscreen mode Exit fullscreen mode

We have updated all of our official SDKs to support the new Conditional Query API for querying and removing data. Read our Guides to learn more about conditional queries and how to use them in your applications.

What next?​

This release introduces only the basic set of logical and comparison operators. We plan to add more operators and functionality to the Conditional Query API in future releases. It will also be available in the replication engine to filter records during the replication process.


I hope you find those new features useful. If you have any questions or feedback, don’t hesitate to use the ReductStore Community forum.

Thanks for using ReductStore!

reductstore Article's
30 articles in total
Favicon
ReductStore v1.13.0 Released With New Conditional Query API
Favicon
Keeping MQTT Data History with Node.js
Favicon
ReductStore v1.12.0 released: record deletion API and storage engine optimization
Favicon
3 Ways to Store Computer Vision Data
Favicon
ReductStore v1.11.0: Changing labels and storage engine optimization
Favicon
Getting Started with ReductStore in C++
Favicon
How to Keep a History of MQTT Data With Rust
Favicon
Deploy ReductStore as Azure Virtual Machine
Favicon
Getting Started with ReductStore in Node.js
Favicon
Getting Started with ReductStore in Python
Favicon
ReductStore v1.10.0: downsampling and optimization
Favicon
ReductStore CLI Client now in Rust
Favicon
Time Series Blob Data: ReductStore vs. MongoDB
Favicon
Time Series Blob Data: ReductStore vs. TimescaleDB
Favicon
ReductStore v1.9.0 Released
Favicon
How to Keep a History of MQTT Data With Python
Favicon
Performance comparison: ReductStore Vs. Minio
Favicon
ReductStore v1.8.0 Has Been Released with Data Replication
Favicon
ReductStore v1.7.0 has been released with provisioning and batch writing
Favicon
ReductStore 1.6.0 has been released with new license and client SDK for Rust
Favicon
ReductStore v1.5.0 has been released
Favicon
ReductStore v1.4.0 in Rust has been released
Favicon
Subscribing new records with Reduct C++ SDK
Favicon
6 weeks with Rust
Favicon
Data Reduction and Why It Is Important For Edge Computing
Favicon
We Are Moving to Rust
Favicon
CLI Client for ReductStore v0.8.0 has been released
Favicon
How to Use "Cats" dataset with Python ReductStore SDK
Favicon
Streamline your edge computing workflows with ReductStore, now available on Snap
Favicon
ReductStore Client SDK for C++ v1.3.0 with Labels Support

Featured ones: