date: 2024-07-10
title: "An integration approach of hybrid databases based on SQL in cloud computing environment"
status: UNFINISHED
author:
- AllenYGY
tags:
- NOTE
- DataBase
- NoSQL
- SQL
publish: True
An integration approach of hybrid databases based on SQL in cloud computing environment
Like temperature sensor connected to oven, fridge or just to measure a room temperature. IoT is network of such things which may communicate with each other or with user.
IoT is having application in various domains like smart city, industrial, medical services, etc.
Temperature, humidity, soil moisture sensors are used in the hardware along with the water level detection.
Sprinkler motor is turned ON depending on the inputs from soil moisture and water level in the tank. If the soil moisture level drops below the threshold value and if water level is TRUE, then sprinkler motor turns ON.
The data from these sensors is collected and is sent to database server and user email ID. The aim is to further utilize this data for analysis using data processing tools.
Data is stored in both MySQL and MongoDB database systems for carrying out the comparison study.
Db.collection.insert({
sensor_id: <sensor ID number>,
Humidity: <humidity sensor reading>,
Soil_moisture: <moisture sensor reading>,
Temperature: <temperature sensor reading>,
CreateDate: new Date(),
Userid: <User ID>
})
Here is the summary of the first two experiments from the document comparing MySQL and MongoDB databases for an IoT application:
Measure the response time of SELECT queries with varying numbers of threads.
These experiments highlight the differences in performance characteristics between MySQL and MongoDB, with MongoDB showing advantages in handling write operations under load, while MySQL maintained more stable read performance with higher thread counts.
Each database has its own advantages and disadvantages.
Scenario: Improve read performance and reduce database load.
Example:
When a user requests data, the application first checks the Redis cache. If the data is found in the cache, it is returned immediately. If not, the data is fetched from MySQL, then stored in Redis for future requests. This approach reduces the load on MySQL and improves the overall response time of the application.
场景:提高读性能,减少数据库负载。
MSI mainly includes eight components