Coder Social home page Coder Social logo

Comments (5)

mrjgreen avatar mrjgreen commented on August 27, 2024 1

Nice idea - not sure why I never included that as an option.

As a first step I'll put in a '--hash <crc32|md5|sha1>' flag, leaving md5 as the default to avoid any BC breaks.

I'm interested to discuss other algorithms further.

The algorithm is only hashing small chunks of rows (--block-size default:1024) so the chances of there being data differences that cause a hash collision should be small, even with MD5.

I am certain that I have seen hash collisions with CRC32, so perhaps this algorithm should be discouraged, but on the other hand its nice and fast... so for big tables comparing just a few fields it could be useful.

Happy to include extra algorithms - fancy submitting a PR with your recommendations?

from db-sync.

mrjgreen avatar mrjgreen commented on August 27, 2024 1

Sure! I've published release v3.3.0 which includes the new --hash option

https://github.com/mrjgreen/db-sync/releases/tag/v3.3.0

from db-sync.

mrjgreen avatar mrjgreen commented on August 27, 2024

'--hash (-H) <crc32|md5|sha1>' opt added in a058245

from db-sync.

dotnetCarpenter avatar dotnetCarpenter commented on August 27, 2024

Actually, my recommendation is to select a hashing algorithm that fits the selected --block-size and the similarities of the data one wants to sync.

There is no best algorithms but it possible to calculate collision probability. Talking about CRC32, plumless and buckeroo supposedly give the same hash. http://preshing.com/20110504/hash-collision-probabilities/

I have a bunch of columns with only default values. I should probably exclude them from my hashing via --ignore-comparison. I think you have all the tools to do a correct synchronization.

If I find a magic algorithm, I will update the issue but for now - everything looks good 👍

from db-sync.

dotnetCarpenter avatar dotnetCarpenter commented on August 27, 2024

@mrjgreen Can you please publish a new release with the -H flag? I would like to use composer on the production server and not git clone your project.

Thanks!

from db-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.