Skip to content

Random sequence resolver #48

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

Open
mikkpokk opened this issue May 17, 2024 · 2 comments
Open

Random sequence resolver #48

mikkpokk opened this issue May 17, 2024 · 2 comments

Comments

@mikkpokk
Copy link

mikkpokk commented May 17, 2024

I want to point it out, current solution deppends on random sequence resolver, which is usually not the best option.

It works well when IDs are generated by 1 process, but there's no way to guarantee overlap of the IDs, when several different processes will generate the ID. That is the case when your application runs on webserver. Each request has their own unique information about the class constructor.

Consider using https://github.com/godruoyi/php-snowflake with https://github.com/kra8/laravel-snowflake instead to make it more maintainable and flexible.

I would say, currently it's not the best to use kra8/laravel-snowflake on high traffic web application.

@kra8
Copy link
Owner

kra8 commented May 17, 2024

Thank you for pointing that out.I completely agree with you.

Unfortunately, I don't have the time to continue maintaining this package at the moment.

Personally, if php-snowflake implemented the HasSnowflakeId Trait, I would prefer to use that instead.

@kra8 kra8 pinned this issue May 17, 2024
@calebdw
Copy link

calebdw commented Jul 19, 2024

@kra8

Unfortunately, I don't have the time to continue maintaining this package at the moment.

I just published a new package that integrates quite well into Laravel and uses php-snowflake under the hood for safe sequence generation, feel free to check it out!

https://github.com/calebdw/laraflake

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

3 participants