Link to home
Start Free TrialLog in
Avatar of RGuillermo
RGuillermoFlag for United States of America

asked on

Mysql database, What happens when it shutsdown

Hello Experts,
Our app uses mysql, its being distributed and installed in several laptops of our customers company.
My quiestion is what happens when a random laptop shuts down? here are two scenarios:

1. a Random laptop is shutdown properly by the user.
2. A random laptop goes shutdown because of lack of energy.

will the database lose info?
Shall we install or follow a procedure to stop and shutdown the database as many times as possible?
What would be this procedure?

Regards,
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

>>What happens when it shutsdown

no one can access the DB. Applications/db users etc..
Avatar of Olgierd Ungehojer
Olgierd Ungehojer

Are you using transaction in your database or not ? If not and you have long query to DB you may loos some data and insert some part of data to some table, this may cause some problems. With transaction DB this process looks different, because before you insert or update data your application have to lock records or tables, so you may loos  data and corrupt your database. Your users should run backups to be able restore database in some situations. I would not recommend shutdown laptops when you using your database. This one of the reason to have database on server and using clients application to connect  to database on the server.
What is the purpose of the local mysql versus anothe.
What is your application?
The local DB might be just a local repository for interaction with an external .....
Avatar of RGuillermo

ASKER

Yes we are using transactions,
The purpose of the app is to pick up data in remote location for mining exploration,
So exploring engineers perform some tests and calculations and pickup data from these locations
all info is entered into our app, all works just fine.

But I have noticed some engineers just turn of their laptops for many reasons
because they are traveling, or weather became difficult, many reasons.
and by accident, some get their laptop shutdown because of lack of power.

We have had no problems yet but then I would like to prevent on this regard.
Does your setup include a mechanism/service that syncs out data collected .
It sounds as though you are dealing with a situation that is collected while outside of connection and can not be sync up.

I.e. The setup is a hub and spoke type
I.e an engineer takes with a job, retrieves the info from the main MySQL accessible at all times...
When their task is complete, the data they collected is supposed to be sync back to the main MySQL?
we do sync to a main server.
most explorers even use satelital conectivity
but we do have situations when some users are disconected while working for several hours.
And they do turn off the laptop or it shuts down on its own.
for these cases
 
What is the correct procedure to fast and easily first shutdown the database and then the laptop?

or maybe as the laptop shutsdown the database sees/detects it and it also shutsdown itself?
That would explain why we have not had problems yet with theses two situations..

Please your advice on how best to deal with shuting down a mysql database in working laptops.
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes my fear us to find out (probably too late) that there was data, or some data that may not have been uploaded to the main server....
But then, I think Olgierd proposal to modify the app to have additional temporal files in the laptops will provide us with greater certainty ... that added to the importan fact the that we need to upload the data as soon as possible.
Thnak you so much experts!
I will talk on theses regard to our development team.
Regards
Thank you very much!
Not sure what the point of files is compared, to have an entry in the database to reflect whether the data has been uploaded.

I.e.  A transactional table in the DB referencing items that need to be sync up. When the data is uploaded , a column indicates that the entry was uploaded, when the data is sync back in, the transaction entry gets deleted..
Nothing will prevent/eliminate the possibility of data loss in the event the laptop is lost, damaged...

An indication in the application, interface that There is data that has not been synchronized.

The concern is more a procedural issue "requiring" the remote user to sync data at the earliest opportunity, or .......
Thank you Arnold yes I am working on training and making engineers aware of the importance of uploading as soon as possible,
Also we are recomending good protectors for laptops in those environments.
Potentially, when an engineer pulls a job, it is marked on the main that Engineer X has the task.
Until the data is uploaded, the status of the Task remains locked, meaning no other engineer can pull the task to perform, the task can be pulled and looked at.
The nature of the environment you are in, uploaded data might not be complete, so the engineer potentially has to make the additional step to indicate that the task is complete. the tools presumably on the user's side validate the requirements, while...

Much depends on what you are looking for.
Presumably because of the proprietary nature of the data (value as well) do the engineers also have email accounts secured with certificates and permitted to email encrypted ..

one way is in addition to the database sync/upload when complete, the software will also generate an encrypted email with the data as a "backup"
Yeh, neither will shield the data loss in the event of a HW failure.
VEry important information I definitley will look to have those topics considered and implemente.
Thank you so much!