-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
📝 [Proposal]: middleware/requestID -> use faster alternatives #3398
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
Comments
In what scenarios does uuid need to be sorted? |
In this scenario (requestId) it probably doesn't matter, unless somehow the request id ends up in a database (maybe some diagnostics service that tracks errors/performance of endpoints). But if it's in a database, perhaps you don't need to store created_at time field in some scenarios if you were only interested in ordering. UUID will require a created_at time field. ulid will not (if you aren't interested in exact creation time, but just the ordering) |
uuid is a library maintained by Google, who pioneered the go language. So I don't see the need to replace the uuid library if it's not a big breakthrough |
However, perhaps we can customize the use of ulid , as a middleware, through other implementations |
The proposal was just to change the default id generator because it's faster and Fiber is all about speed.
The middleware api already allows the user to replace the id generator with whatever they want including ulid. |
you are right |
what do you think of this? |
@JIeJaitt the proposal was just for this middleware. If a user wants to use ulid, they can add the dependency themself. |
Feature Proposal Description
Instead of a default generator of uuid, perhaps https://github.com/oklog/ulid which is faster and shorter
Alignment with Express API
N/A
HTTP RFC Standards Compliance
https://github.com/ulid/spec
API Stability
N/A
Feature Examples
Checklist:
The text was updated successfully, but these errors were encountered: