Lurker News
Hi! I wanted to share an open source API-compatible replacement for SQS. It's written in Go, distributes as a single binary, and uses SQLite for underlying storage.

I wrote this because I wanted a queue with all the bells and whistles - searching, scheduling into the future, observability, and rate limiting - all the things that many modern task queue systems have.
But I didn't want to rewrite my app, which was already using SQS. And I was frustrated that many of the best solutions out there (BullMQ, Oban, Sidekiq) were language-specific.
So I made an SQS-compatible replacement. All you have to do is replace the endpoint using AWS' native library in your language of choice.
For example, the queue works with Celery - you just change the connection string. From there, you can see all of your messages and their status, which is hard today in the SQS console (and flower doesn't support SQS.)
It is written to be pluggable. The queue implementation uses SQLite, but I've been experimenting with RocksDB as a backend and you could even write one that uses Postgres. Similarly, you could implement multiple protocols (AMQP, PubSub, etc) on top of the underlying queue. I started with SQS because it is simple and I use it a lot.
It is written to be as easy to deploy as possible - a single go binary. I'm working on adding distributed and autoscale functionality as the next layer.
Today I have search, observability (via prometheus), unlimited message sizes, and the ability to schedule messages arbitrarily in the future.
In terms of monetization, the goal is to just have a hosted queue system. I believe this can be cheaper than SQS without sacrificing performance. Just as Backblaze and Minio have had success competing in the S3 space, I wanted to take a crack at queues.
I'd love your feedback!

Comments (156) 39 threads

Earlier comments
memset1 reply#
I have looked at elasticmq but not played with it myself. You might also be interested in their benchmarks of all of the existing queues out there: https://softwaremill.com/mqperf/
julius#
I also just used ElasticMQ in a docker environment. Did you see any specific downsides, when you looked at it? In which scenarios should I consider replacing it with your solution?
cies#
We use ElasticMQ to have an SQS compatible service for local development. We use it with docker-compose locally. In our remote envs we use SQS.

So far I had not problems with ElasticMQ.
I'm much intrigued by the small LOC count of SmoothMQ. When I compare it to ElasticMQ it's much smaller (probably by using sqlite's features).
https://github.com/softwaremill/elasticmq

yimpolo1 reply#
This is super cool! I love projects that aim to create simple self-hostable alternatives to popular services.

I assume this would work without much issue with Litestream, though I'm curious if you've already tried it. This would make a great ephemeral queue system without having to worry about coordinating backend storage.

memset1 reply#
I haven't tried this with litestream! It will be worth exploring that as a replication strategy.

The nice thing about queues is that backend storage doesn't really need to be coordinated. Like, you could have two servers, with two sets of messages, and the client can just pull from them round robin. They (mostly) don't need to coordinate at all for this to work.
However, this is different for replication where we have multiple nodes as backups.

xrd#
Since this is a single go binary I bet it would work perfectly with litestream. I use litestream in the exact same way with Pocketbase and it works perfectly (Pocketbase is also a single go binary). I'm going to give it a try and report back.
ahachete3 replies#
Congratulations!

I also love writing AWS API-compatible services. That's why I did Dyna53 [1] ;P
(I know, unrelated, but hopefully funny)
[1] https://dyna53.io

memset#
This is really fun!
selcuka#
It is fun, indeed. Could be a candidate for the best technology abuse of the year.
bensmoif#
This is an absolutely unhinged project idea. Great work
philippta2 replies#
One quick suggestion on project structure:

Move all the structs from models/ into the root directory.
This allow users of this package to have nice and short names like: q.Message and q.Queue, and avoids import naming conflicts if the user has its own „models“ package.

memset1 reply#
Thanks for the tip - and for even looking at the code! I always struggle to figure out how to organize things.
philippta#
Just noticed that your root directory is already „package main“ so you can either move that to /cmd/something/ or simply rename models/ to q/. That would have the same effect and is also idiomatic.
pqb#
Actually, the "model/" (note: singular form) directory (package model) would be preferred in the golang world.

Load more comments