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

Is it possible let us choose uuid or int as queue ID ? #422

Open
pigochu opened this issue Aug 11, 2021 · 4 comments
Open

Is it possible let us choose uuid or int as queue ID ? #422

pigochu opened this issue Aug 11, 2021 · 4 comments

Comments

@pigochu
Copy link

pigochu commented Aug 11, 2021

If we can use UUID as the ID of the queue, I think we can use MULTI COMMAND in the redis driver to make the performance better

@samdark samdark added the type:enhancement Enhancement label Aug 11, 2021
@samdark
Copy link
Member

samdark commented Aug 11, 2021

Is it possible let us choose uuid or int as queue ID?

Technically yes but that would require significant rework: https://github.com/yiisoft/yii2-queue/blob/master/src/drivers/db/migrations/M161119140200Queue.php#L26

If we can use UUID as the ID of the queue, I think we can use MULTI COMMAND in the redis driver to make the performance better

How much better?

@pigochu
Copy link
Author

pigochu commented Aug 11, 2021

How much better?

I mean only redis driver , if we set an option like "useUuidAsQueueId=true".

In the redis driver , check useUuidAsID === true , if true , then use multi() for insert queue data.

@samdark
Copy link
Member

samdark commented Aug 15, 2021

Yes, I understand that. You've stated that performance gets better. I wonder how much better it is?

@bizley
Copy link
Member

bizley commented Aug 15, 2021

That's interesting. I remember that usually it's other way around - for example in API Platform uuid is recommended as a resource identifier but in addition to an integer database identifier, so DB can run faster and resource identifier cannot be guessed.

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

No branches or pull requests

3 participants