Big Data & Tools with NoSQL
  • Big Data & Tools
  • ReadMe
  • Big Data Overview
    • Overview
    • Job Opportunities
    • What is Data?
    • How does it help?
    • Types of Data
    • The Big 4 V's
      • Variety
      • Volume
      • Velocity
      • Veracity
      • Other V's
    • Trending Technologies
    • Big Data Concerns
    • Big Data Challenges
    • Data Integration
    • Scaling
      • CAP Theorem
      • Optimistic concurrency
      • Eventual consistency
      • Concurrent vs. Parallel Programming
    • Big Data Tools
    • No SQL Databases
    • What does Big Data learning means?
  • Linux & Tools
    • Overview
    • Linux Commands - 01
    • Linux Commands - 02
    • AWK
    • CSVKIT
    • CSVSQL
    • CSVGREP
  • Data Format
    • Storage Formats
    • CSV/TSV/Parquet
    • Parquet Example
    • JSON
    • HTTP & REST API
      • Terms to Know
        • Statefulness
        • Statelessness
        • Monolithic Architecture
        • Microservices
        • Idempotency
    • REST API
    • Python
      • Setup
      • Decorator
      • Unit Testing
      • Flask Demo
      • Flask Demo - 01
      • Flask Demo - 02
      • Flask Demo - 03
      • Flask Demo - 04
      • Flask Demo - 06
    • API Testing
    • Flask Demo Testing
    • API Performance
    • API in Big Data World
  • NoSQL
    • Types of NoSQL Databases
    • Redis
      • Overview
      • Terms to know
      • Redis - (RDBMS) MySql
      • Redis Cache Demo
      • Use Cases
      • Data Structures
        • Strings
        • List
        • Set
        • Hash
        • Geospatial Index
        • Pub/Sub
        • Redis - Python
      • Redis JSON
      • Redis Search
      • Persistence
      • Databases
      • Timeseries
    • Neo4J
      • Introduction
      • Neo4J Terms
      • Software
      • Neo4J Components
      • Hello World
      • Examples
        • MySQL: Neo4J
        • Sample Transactions
        • Sample
        • Create Nodes
        • Update Nodes
        • Relation
        • Putting it all together
        • Commonly used Functions
        • Data Profiling
        • Queries
        • Python Scripts
      • More reading
    • MongoDB
      • Sample JSON
      • Introduction
      • Software
      • MongoDB Best Practices
      • MongoDB Commands
      • Insert Document
      • Querying MongoDB
      • Update & Remove
      • Import
      • Logical Operators
      • Data Types
      • Operators
      • Aggregation Pipeline
      • Further Reading
      • Fun Task
        • Sample
    • InfluxDB
      • Data Format
      • Scripts
  • Python
    • Python Classes
    • Serialization-Deserialization
  • Tools
    • JQ
    • DUCK DB
    • CICD Intro
    • CICD Tools
      • CI YAML
      • CD Yaml
    • Containers
      • VMs or Containers
      • What container does
      • Podman
      • Podman Examples
  • Cloud Everywhere
    • Overview
    • Types of Cloud Services
    • Challenges of Cloud Computing
    • High Availability
    • Azure Cloud
      • Services
      • Storages
      • Demo
    • Terraform
  • Data Engineering
    • Batch vs Streaming
    • Kafka
      • Introduction
      • Kafka Use Cases
      • Kafka Software
      • Python Scripts
      • Different types of Streaming
    • Quality & Governance
    • Medallion Architecture
    • Data Engineering Model
    • Data Mesh
  • Industry Trends
    • Roadmap - Data Engineer
    • Good Reads
      • IP & SUBNET
Powered by GitBook
On this page
  1. NoSQL
  2. Redis

Timeseries

PreviousDatabasesNextNeo4J

Last updated 1 year ago

What is Epoch Time?

TS.CREATE sensor1

type sensor1

DEL sensor1

## Keep 1 month of data

TS.CREATE sensor1 RETENTION 2678400000

TS.ADD sensor1 * 50

(* tells Redis to use the server's current time), 

TS.RANGE sensor1 - +

LABELS:

Organization

Querying

Filtering

Efficiency

TS.CREATE sensor1:32 RETENTION 2678400000

TS.CREATE sensor2:33 RETENTION 2678400000

TS.ADD sensor1:32 * 51 LABELS area_id 32 sensor_id 1
TS.ADD sensor1:32 * 52 LABELS area_id 32 sensor_id 1
TS.ADD sensor1:32 * 50 LABELS area_id 32 sensor_id 1
TS.ADD sensor1:32 * 55 LABELS area_id 32 sensor_id 1

TS.RANGE sensor1:32 <start_timestamp> <end_timestamp>

TS.RANGE sensor1:32 - +

TS.RANGE sensor1:32 - + FILTER_BY_VALUE 45 51
TS.ADD sensor1:32 * 60 LABELS area_id 32 sensor_id 1


TS.ADD sensor2:33 * 25 LABELS area_id 33 sensor_id 2
TS.ADD sensor2:33 * 22 LABELS area_id 33 sensor_id 2
TS.ADD sensor2:33 * 24 LABELS area_id 33 sensor_id 2


## Find the Avg value in 60000 milliseconds (10 min)
TS.RANGE sensor2:33 - + AGGREGATION AVG 60000 

## Find the Avg value in 36000 milliseconds (36 min)
TS.RANGE sensor2:33 - + AGGREGATION AVG 36000 

TS.CREATE sensor1:32:avg_hourly
TS.CREATE sensor2:33:avg_hourly

TS.CREATERULE sensor2:33 sensor2:33:avg_hourly AGGREGATION avg 3600000
LogoEpoch Converterepochconverter