I have two scripts which listen to the same websocket, and write the received packages to a database. In principle, these scripts receive the same packages, but there might be downtime et cetera. I would now like to merge the two streams into one reliable stream, removing duplicates.
However, the packages are not timestamped or id'd, so by just looking at the packages, it is not possible to establish which one came first. It cannot be ruled out that some of the packages are intentionally identical. The packages are timestamped when they arrive at the servers.
Is there a standard, principled approach to solve this problem?