Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add random jitter to selected indexes? #14

Open
aboodman opened this issue Nov 28, 2022 · 4 comments
Open

Add random jitter to selected indexes? #14

aboodman opened this issue Nov 28, 2022 · 4 comments

Comments

@aboodman
Copy link
Contributor

See https://madebyevan.com/algos/crdt-fractional-indexing/

I wonder if there is a principled way to choose the amount of jitter such that collisions are ~impossible.

@tantaman
Copy link

You can also just allow conflicts and repair them iff someone tries to insert between conflicting items. You'd have to of course order by fract_index, primary_key (or something similar) to ensure a stable sort in the face of conflicts.

@aboodman
Copy link
Contributor Author

Yeah I think we discovered this ourselves too. There are a number of patterns to deal with conflicts and I'm not sure which is best, I keep oscillating between options :).

@quolpr
Copy link

quolpr commented Mar 23, 2023

Would it be possible to add support for random jitter as an option?

@codsane
Copy link

codsane commented May 10, 2024

@quolpr if you are still looking, this seems promising: https://github.com/TMeerhof/fractional-indexing-jittered.

While not a fork, it is apparently inspired by this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants