ktageja / DataSense-PRJ666-team-5

MIT License
0 stars 0 forks source link

Use Case 13: NoSQL Database Schema Design for Sensor Data #16

Open ktageja opened 3 days ago

ktageja commented 3 days ago

NoSQL Database Schema Design for Sensor Data

User Story

As a backend developer, I want to design and implement a NoSQL database schema to store sensor data efficiently so that it can be retrieved quickly for real-time and historical analysis.

Description

This use case involves designing a NoSQL database schema to store temperature, humidity, and moisture data collected from Raspberry Pi devices. The database needs to store sensor readings along with timestamps to allow for real-time and historical queries. The schema should also handle large amounts of data efficiently over time and include appropriate indexing to ensure quick retrieval.

Acceptance Criteria

Testing

Normal Flow of Events

The backend developer designs a database schema using a NoSQL database (e.g., MongoDB). Sensor data (temperature, humidity, moisture) is stored in the database with timestamps. Sample queries are tested to retrieve both real-time data (last X minutes) and historical data (date ranges). The database performs efficiently, retrieving data within acceptable response times for both real-time and historical queries.

Alternate/Exceptional Flows:

S-1: Schema does not support efficient querying

The schema is inefficient for querying large datasets, leading to slow response times. The developer refines the schema or adds appropriate indexing to improve query performance.

S-2: Data insertion errors

Sensor data is not correctly inserted into the database due to missing fields or incorrect data types. The developer adjusts the schema or validation process to ensure data is inserted correctly.