VictorKwong / DataSense-PRJ666-team-5

https://prj666deploy-9xd1.vercel.app
MIT License
0 stars 0 forks source link

Use Case 13: NoSQL Database Schema Design for Data #21

Open ktageja opened 1 month ago

ktageja commented 1 month ago

NoSQL Database Schema Design for Data

User Story

As a backend developer, I want to design and implement a NoSQL database schema to store 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 as. 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.

VictorKwong commented 1 week ago

The schema will continue to be updated in Sprint 4.

Fields: Email Password OAuth Provider Username Contact Number

Sensor Data: Date Temperature Moisture Humidity