yii2-queue icon indicating copy to clipboard operation
yii2-queue copied to clipboard

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

Open pigochu opened this issue 4 years ago • 4 comments

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

pigochu avatar Aug 11 '21 09:08 pigochu

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?

samdark avatar Aug 11 '21 10:08 samdark

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.

pigochu avatar Aug 11 '21 11:08 pigochu

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

samdark avatar Aug 15 '21 13:08 samdark

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.

bizley avatar Aug 15 '21 13:08 bizley