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,
RGuillermoProject ManagerAsked:
Who is Participating?
 
Olgierd UngehojerSenior Network AdministratorCommented:
Are you worry about local database or about data what they wrote down and did not safe yet? I think that transfer data to main database is not issue because there is mechanism what check that transfer is complete or not. I think that software on the laptop should generate some temp. file with data what can be easily restore in case when user type some data and did not finished.
0
 
Pawan KumarDatabase ExpertCommented:
>>What happens when it shutsdown

no one can access the DB. Applications/db users etc..
0
 
Olgierd UngehojerSenior Network AdministratorCommented:
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.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
arnoldCommented:
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 .....
0
 
RGuillermoProject ManagerAuthor Commented:
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.
0
 
arnoldCommented:
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?
0
 
RGuillermoProject ManagerAuthor Commented:
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.
0
 
arnoldCommented:
Not quite sure, a shutdown of the laptop will..

There is nothing you can do if there is no connection, you seem to be looking at the point of getting the data added as soon as possible.

The mechanism potentially already includes a way on the local system to indicate whether the data that was added has been transferred out such that the next time the laptop is on and the connectivity is present the data from the local is uploaded?
Or do you encounter situations that data was collected, but would not be uploaded to the main MySQL?
0
 
RGuillermoProject ManagerAuthor Commented:
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!
0
 
RGuillermoProject ManagerAuthor Commented:
I will talk on theses regard to our development team.
Regards
0
 
RGuillermoProject ManagerAuthor Commented:
Thank you very much!
0
 
arnoldCommented:
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 .......
0
 
RGuillermoProject ManagerAuthor Commented:
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.
0
 
arnoldCommented:
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"
0
 
arnoldCommented:
Yeh, neither will shield the data loss in the event of a HW failure.
0
 
RGuillermoProject ManagerAuthor Commented:
VEry important information I definitley will look to have those topics considered and implemente.
Thank you so much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.