# LavinMQ, an open-source message broker written in Crystal

Hi HN. I'm Carl, creator of LavinMQ. LavinMQ is an open-source message broker. AMQP 0-9-1, MQTT, HTTP and streaming. Single binary, minimal resource use. If you know RabbitMQ, it's that (but running on a fraction of hardware). We're the team behind CloudAMQP where we've hosted RabbitMQ for 14 years…

- **Page:** https://magpie.gallery/i/lavinmq-an-open-source-message-broker-written-in-c-qu9n
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** message-broker, amqp, mqtt, open-source, streaming

## Source

Web · CarlHoerberg: LavinMQ, an open-source message broker written in Crystal

- **Original:** https://news.ycombinator.com/item?id=47933145

> Hi HN. I'm Carl, creator of LavinMQ. LavinMQ is an open-source message broker. AMQP 0-9-1, MQTT, HTTP and streaming. Single binary, minimal resource use. If you know RabbitMQ, it's that (but running on a fraction of hardware). We're the team behind CloudAMQP where we've hosted RabbitMQ for 14 years. Sometimes customers hit issues we couldn't fully explain / work around. So we built our own broker, in order to provide solutions where we previously couldn't (which is much easier when you control the full stack). It all started by me building an open-source AMQP proxy to handle short-lived connections for a customer, to avoid heavy connection churn on cpu. Once the protocol was implemented, adding a persistence layer seemed like a fun challenge. How hard could it be? Turns out the protocol was the easy part. Reliable disk storage, ack handling, and replication was harder. It took years. Our first release was pushed in 2020 and today it runs on 5,000+ production instances on CloudAMQP. LavinMQ is written in Crystal (LLVM-compiled, Go-like concurrency, Ruby-like syntax). Messages go straight to disk via memory-mapped files, no in-memory cache. Append-only writes for both messages and acks. The whole design is built around minimizing memory copies, allocations and syscalls. Numbers: ~580k msgs/sec on a t4g.micro (2 vCPU, 1 GB RAM). Over 1M msgs/sec on a c8g.large (2 vCPU, 4 GB). Try it: docker run -p 15672:15672 -p 5672:5672 cloudamqp/lavinmq We are curious to hear: how are you handling messaging today? What would make you consider switching broker? https://github.com/cloudamqp/lavinmq

## GitHub projects

- https://github.com/cloudamqp/lavinmq

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
