K
K
Kirill Petrov2016-04-10 14:09:36
PHP
Kirill Petrov, 2016-04-10 14:09:36

How to organize delayed application of changes in mysql?

There is a site where a PHP script processes an xml file in the background and makes changes to the site about products / categories.
Tell me how to first make changes to the database, and when everything is ready and the PHP script finishes its work, apply the changes.
Now the volume of xml files has increased and the php script needs about half an hour to disassemble.
There is an idea to create a second database, a copy, where to make changes, and then generate an SQL script and execute it on the main database. But maybe there is something easier?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2016-04-10
@Recosh

START TRANSACTION / COMMIT

J
jeezic, 2016-04-10
@jeezic

If it is possible to make changes to the database structure and to the logic of the application, then you can add a flag to the tables, which will mean that the record is not yet ready for production.
Remove the flag at the end of data processing - this is where transactions come in handy.

R
Roman Mirilaczvili, 2016-04-10
@2ord

Try Queues in php?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question