B4J Question B4J Server With MySQL

embedded

Active Member
Licensed User
Longtime User
I want to make a B4J Server with MySQL Running on my Raspberry pi in which i want to store Temperature and Humidity of Various Places of my house. Kindly guide my that for MySql what i have to do. WAMP Server/Apache server/MySql Server or any other things which have to implement for minimal load on my raspberry pi. of course it should be more reliable. Kindly Guide me.
 

embedded

Active Member
Licensed User
Longtime User
Thanks EREL for your response. "Installing MySQL is enough" This quote means you are talking about my sql server. am i right. Basically my background is electronics i don't have any idea about database. I entered in this field because of B4X family and there simplicity and support.
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
"Installing MySQL is enough" This quote means you are talking about my sql server. am i right.

Yes.. you can install MySQL (server) on an RPi using the following simple steps if you have a headless RPi Server:

sudo apt update
sudo apt install mysql-server

Then you can remotely access the server using a Windows application like HeidiSQL to configure it.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
How often are you collecting/storing data?

How long are you storing the data for? Weeks? Months? Years?

SQLite would be fine for millions of records.


I want to make a B4J Server with MySQL Running on my Raspberry pi in which i want to store Temperature and Humidity of Various Places of my house. Kindly guide my that for MySql what i have to do. WAMP Server/Apache server/MySql Server or any other things which have to implement for minimal load on my raspberry pi. of course it should be more reliable. Kindly Guide me.
 
Upvote 0

embedded

Active Member
Licensed User
Longtime User
How often are you collecting/storing data?

How long are you storing the data for? Weeks? Months? Years?

SQLite would be fine for millions of records.
There are 100 devices sending there data which is logged into mysql server in frequency of every three to 5 minutes. Each machine data length is about 40 bytes only. which one is better sqlite or mysql. only i have to keep data of two month only.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
You can easily limit the record count if readings from the same device are stored together for a given time slot. For example, one hour of readings account for 20 messages If frequency is 3 minutes. With a message length of 40 bytes you will have a record slightly over 800 bytes when you add IDs and timestamps.
So each device will have its 24 records a day or 1440 for two months of data and the whole db will contain144000 records for the 100 devices.
A number easily managed by any db.
 
Upvote 0

embedded

Active Member
Licensed User
Longtime User
You can easily limit the record count if readings from the same device are stored together for a given time slot. For example, one hour of readings account for 20 messages If frequency is 3 minutes. With a message length of 40 bytes you will have a record slightly over 800 bytes when you add IDs and timestamps.
So each device will have its 24 records a day or 1440 for two months of data and the whole db will contain144000 records for the 100 devices.
A number easily managed by any db.
Thanks
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
There are 100 devices sending there data which is logged into mysql server in frequency of every three to 5 minutes. Each machine data length is about 40 bytes only. which one is better sqlite or mysql. only i have to keep data of two month only.

At 5 minute intervals you will be logging 29k rows a day or 1.7 million for two months.

I would give SQLite a try first.
 
Upvote 0
Top