zlacker

[parent] [thread] 6 comments
1. zamuba+(OP)[view] [source] 2022-09-06 04:54:38
Why not just use Redis streams for the queue over the Redis list impl.?
replies(3): >>dangri+f1 >>welder+E1 >>nurett+Dk
2. dangri+f1[view] [source] 2022-09-06 05:04:30
>>zamuba+(OP)
Why not just use a simple FTP server with curlftps to replace Dropbox then? ;)

But honestly, it seems like you did not read the article at all. That’s seems to be exactly what they do for the queue part, but you still need to manage the workers executing the tasks, lifecycle management and interfacing/serialization/deserialization for the tasks and results

replies(1): >>blowsk+05
3. welder+E1[view] [source] 2022-09-06 05:08:22
>>zamuba+(OP)
New: Streams are append only, but I push eta tasks onto the front of a queue when their time is ready to run. Looks like streams could work and might even be better suited instead of lists, but I would have to figure out some way to run eta tasks before other pending tasks in a queue.

Old when I confused streams with pubsub: Streams aren't durable... a worker goes offline for a second and all of a sudden you lost all your pending tasks. Redis lists are durable, so you can add tasks first then boot up a worker later and the worker will process those waiting tasks. With streams, the worker wouldn't see any pending tasks when it boots.

replies(1): >>zamuba+R3
◧◩
4. zamuba+R3[view] [source] [discussion] 2022-09-06 05:31:20
>>welder+E1
AFAIK, streams are treated as any Redis data type and stored on disk making them durable. Redis even allows you to use an append only file and the database snapshot for persistence/durability with differing levels of requirements (eg. every operation, every n seconds, never). Though I'm not sure if the streams are handled the same in terms of high availability though...

Also while plain XREAD doesn't give you pending tasks, using consumer groups and look at XREADGROUP (specifically using ID = 0 to get all pending tasks) should get you all pending tasks before continuing onto unseen tasks. There is also XCLAIM and XAUTOCLAIM which you can filter the pending tasks by how long they have gone unacknowledged for and have another worker claim the tasks.

replies(1): >>welder+96
◧◩
5. blowsk+05[view] [source] [discussion] 2022-09-06 05:43:23
>>dangri+f1
From the guidelines:

> Please don't comment on whether someone read an article.

◧◩◪
6. welder+96[view] [source] [discussion] 2022-09-06 05:51:58
>>zamuba+R3
Oh sorry, somehow I thought we were talking about pubsub.
7. nurett+Dk[view] [source] 2022-09-06 08:02:28
>>zamuba+(OP)
It is a good question. Maybe because they aren't conceptually as simple as lists and require recent versions of redis. And maybe because xstream is persisting which means they use the disk and lists are not (unless you have incremental dumps turned on)
[go to top]