Which is better, SplQueue queue or redis list queue in php spl? What are the advantages and disadvantages and the application scenarios?

if you want to know the advantages and disadvantages and application scenarios of SplQueue in php, usually your own implementation queue is usually implemented with redis"s list, and you want to know the difference. Thank you

Php
Jan.20,2022

uses PHP SplQueue , this PHP is a memory-resident service.

SplQueue in PHP memory, it is fast, and there is almost no IO . It is suitable for asynchronous processing that allows certain data loss. The disadvantage is that restart service data will be lost and cannot be processed across machines or services.

redis queue, if redis has high availability and persistent processing, then the data is relatively safe and can be processed by programs in different languages, such as PHP sending data into the queue, JAVA processing data, or multiple processors to form a highly available cluster. The cost is network IO and external dependency

.
Menu