4 ms·
Having a queue means you have a distributed system. How do you handle network problems, errors/retries, back pressure? OTP has excellent idiomatic tools for all
by polmuz 6y ago
Having a queue means you have a distributed system. How do you handle network problems, errors/retries, back pressure? OTP has excellent idiomatic tools for all that and more.
- jeremyjh 6y agoElixir developers who need a queue generally reach for Rabbit (which any language can use), or something backed in a database like rihanna[1] or honeydew[2]. Rolling your own distributed system is very much a last resort, and despite its excellent concurrency characteristics the BEAM still lacks basics such as a battle-tested raft implementation. [1]https://github.com/samsondav/rihanna https://github.com/samsondav/rihanna [2]https://github.com/koudelka/honeydew https://github.com/koudelka/honeydew
- zambal 6y ago> and despite its excellent concurrency characteristics the BEAM still lacks basics such as a battle-tested raft implementation. A couple of years ago the RabbitMQ team has published a raft library[1] which they use in their implementation of persistent queues. It has a flexible API and implementing your own state machines is quite straightforward, as it follows the OTP gen_* behaviour paradigm. And by now, I'd say it's pretty well battle-tested. [1] https://github.com/rabbitmq/ra https://github.com/rabbitmq/ra
- jeremyjh 6y agoI didn’t know about that - thank you for pointing me at it!