Embodiments of the present application provide a
data synchronization method, an electronic device, a storage medium and a
computer program product. The
data synchronization method comprises: obtaining, by using a script program, a to-be-synchronized data table in a first
database, and obtaining an end time corresponding to a last synchronization operation of each to-be-synchronized data table, executing, by using a
backup script program, a synchronization operation on a first to-be-synchronized data table (a lagging to-be-synchronized data table), and executing, by using a main script program, a synchronization operation on a second to-be-synchronized data table (a normal to-be-synchronized data table), to synchronize the first to-be-synchronized data table and the second to-be-synchronized data table to a second
database. The script program does not need to depend on external components, is lightweight, flexible, easy to configure and maintain, and the
backup script program can perform compensation synchronization on the lagging unsynchronized data, and when the main script program fails, the
backup script program can take over its work, and the real-time performance and reliability of
data synchronization can be ensured.