-
Notifications
You must be signed in to change notification settings - Fork 9
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
File sorting #1
Comments
Hi Carlos. The KSUID algorithm only lexically orders by the timestamp component. This means that if you generate one ID per second, the entire body of IDs will always be lexically sortable. With a higher time resolution, you could achieve more IDs per second and retain some sort of lexical order. What do you think if that is created as a configuration? Perhaps you can also elaborate your use case here. Cheers! |
Hi akhawaja. Thank you for your answer. I've read the blog post again and it's totally true that the 1 second resolution is there. But it also says that more resolution can be traded for less random bits.
Is that what you mean by "created as a configuration"?
Sure. I'm capturing the messages a 3rd party system sends into my application. The goal of this is to be able to replay what was received. As an easy way to keep the inputs sorted, I thought about giving the files a UUID name. The files are created with a fixed number of messages. If the sender sends in one burst 5x that number, I'll have 5 new files created at nearly the same moment. I don't need those files to be sorted to each other. In the Thanks! |
Curious. I'll have to make some time to dig in a little deeper and understand why that is happening. Thank you for sharing details about your use case.
Yes, that is what I meant. I have not looked at this work in quite a while. I'll report back here when I am able to sit down and work on this. |
I'll try to find some time and do some digging of my own. I'll PR if I find something. Thanks for your quick answers. |
Hi,
I just found this library searching for a way to generate time based sortable UUIDs that don't give up sensitive information. I'm using the Ksuid to generate file names and provide file rotation.
So I have a bunch of files, but it looks like new ones are being sorted in the middle of the rest, and if I understood the blog post correctly,
sorting the files either by name or by reverse creation date should yield the same result, but it's not the case:
The text was updated successfully, but these errors were encountered: