Data sync execution optimisation #81

Closed
opened 2022-06-15 05:26:02 +00:00 by jamie · 4 comments
jamie commented 2022-06-15 05:26:02 +00:00 (Migrated from git.hazaar.io)

Currently, when we migrate a data sync will be performed ONLY when the tables change. However, there is an option to force the data sync to be executed.

Such as:

<?php
$db = new Hazaar\DBI\Adapter();
$manager = $db->getSchemaManager();
$manager->migrate(null, true);

I would like to optimise this so that instead of executing a data sync when the schema changes and having to force it to execute just in case the data sync files have changed. I would like to create a unique hash code for the current state of the data sync files, and if that is not the same hash from the last data sync, then execute the sync.

With this change, the force parameter can be used to actually force the sync to always run, but we no longer have to use it to get a sync to run when the data sync files have changed but there is no migration. These two decisions are now independant.

Currently, when we migrate a data sync will be performed ONLY when the tables change. However, there is an option to **force** the data sync to be executed. Such as: ```php <?php $db = new Hazaar\DBI\Adapter(); $manager = $db->getSchemaManager(); $manager->migrate(null, true); ``` I would like to optimise this so that instead of executing a data sync when the schema changes and having to force it to execute just in case the data sync files have changed. I would like to create a unique hash code for the current state of the data sync files, and if that is not the same hash from the last data sync, then execute the sync. With this change, the **force** parameter can be used to actually force the sync to always run, but we no longer have to use it to get a sync to run when the data sync files have changed but there is no migration. These two decisions are now independant.
jamie commented 2022-06-15 05:26:02 +00:00 (Migrated from git.hazaar.io)

assigned to @jamie

assigned to @jamie
jamie commented 2022-06-15 05:26:05 +00:00 (Migrated from git.hazaar.io)

created branch 81-data-sync-execution-optimisation to address this issue

created branch [`81-data-sync-execution-optimisation`](/hazaar/hazaar-dbi/-/compare/master...81-data-sync-execution-optimisation) to address this issue
jamie commented 2022-06-15 05:31:07 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !51

mentioned in merge request !51
jamie commented 2022-06-15 05:56:02 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 3352c89ee4

mentioned in commit 3352c89ee4e5e74bdeebb2276d11e31023fbdb86
jamie (Migrated from git.hazaar.io) closed this issue 2022-06-15 05:56:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-dbi#81
No description provided.