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?

RGuillermoProject ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
>>What happens when it shutsdown

no one can access the DB. Applications/db users etc..
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.
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 .....
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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.
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?
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.
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?
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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!
RGuillermoProject ManagerAuthor Commented:
I will talk on theses regard to our development team.
RGuillermoProject ManagerAuthor Commented:
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 .......
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.
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.
RGuillermoProject ManagerAuthor Commented:
VEry important information I definitley will look to have those topics considered and implemente.
Thank you so much!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.