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
PanMan3 replies#
Correct me if I’m wrong but: SQLite sounds like: runs on one server. While that will work most of the time, it won’t work 100% of the time. I don’t know the specifics, but I’m fairly sure if a queue server crashes, SQS will keep working, as stuff is redundant. So while it can work in a best case, this (probably) won’t have the same reliability as SQS has..
memset1 reply#
I break it down two ways.

First, the project does not yet have a distributed implementation, you’re correct. Stay tuned!
Second, SQLite is incidental. Data is still stored on disk, just as SQS must be, but I’ve chosen SQLite as the file format for now.

22c#
Strictly speaking, SQS does not necessarily store data on disk and being highly available and fault tolerant does not exclude one from operating a completely volatile data store. Indeed, SQLite itself has an in-memory option which, when appropriately architected, could be used as the primary data store for a highly available and fault tolerant queue.

Having said that, I think it is safe to assume that SQS probably stores information to non-volatile storage.
Nice work on the project!

parhamn#
The choice of SQLite is a great one as the distributed sqlite space is also growing. You have things like rqlite (raft+sqlite), and you have cloudservices like CloudFlare D1 which is basically distributed/HA sqlite. Plus you can swap it for basically any other sql database.
jpc0#
Does this even need to compete feature wise with SQS?

If it faithfully reproduces the SQS Api what could possibly stop me from using this product now (if he ever does hosted) and then switching to SQS if the scale is ever justified?
I'm all for a full suite of solutions targeting the same API. Can I run this thing on a single server with my dashboard app for the 3 person team I'm developing for and all that it cost them is per hour for tech support and server hardware and deloy my multi million user app on SQS but have effectively the same code.

stuaxo2 replies#
Good, we need open implementations of all the AWS stuff.

I swear they reimplement stuff we have just so there are more places to bill us.

memset2 replies#
Curious: if you were going to switch, how would you want to run this? Would you want to deploy it to your own EC2 instances, or would you want a hosted solution (just as SQS itself is?)
stackskipton1 reply#
Self hosted probably. Why buy knock off SQS in the cloud when real thing is right there?

If you are greenfield and scared of hitching yourself to Amazon, why not go something like RabbitMQ? There is also RabbitMQ cloud providers as well.

jpalomaki1 reply#
Unless you need the features, I would steer away from the "real message queues". Running these adds complexity, especially if you want higher availability and they are not always cheap.

HTTP based solution is easy to understand and implemented (if basic functionality is enough for your use case). Real MQs obviously have more complex protocols and not all client libraries are perfect.

Continue this thread — 1 reply

nilamo#
Ideally this would be run within a k8s cluster, to easily fit with the other services.
paulddraper2 replies#
SQS is cheap.

10m requests for $4.
You will need hundreds of millions of requests per month for it to be noticable.
And can an implementation like this even help you at that point?

memset1 reply#
Question: is there any feature set (in contrast to pricing) that would make it worthwhile for someone to switch?
threecheese2 replies#
Operations. At my $bigCo we are always rolling our own ops tooling for queues, as it’s more than just “reprocess message”; there is always some business logic that separates different types of consumers/destinations, and so q management is never straightforward. Might be a differentiable feature.

Continue this thread — 2 replies

mlhpdx#
Not just cheap per message, but queues themselves are free so there is zero “reserved” cost - it’s pay per message.

Add to that, it’s enormously scalable in terms of throughput and retained messages.
And it’s globally available.
A single file app is no comparison, really. The value of SQS is in the engineering.

crazysim2 replies#
I think the vibe might be that this is something someone could use for production.
mtndew4brkfst2 replies#
With no distribution model and built on SQLite, it certainly doesn't scream "production candidate" to me.
ku1ik#
There’s more production systems on this planet running on a single node than ones running in a distributed setup. And SQLite is a rock solid database, deployed in more places than Postgres. The only thing here that could be taken when weighing production readiness would be the maturity and stability of this project itself.
gkbrk#
You know there are millions of production deployments of SQLite right? It's perhaps the most widely deployed database.
mannyv#
"Production" is a big word to use for a piece of software. There are different levels of "production ready," depending on what you care about.

Some enterprise production questions:
* Is it HA? What HA topology is it designed for? * How many messages-per-second can it ingest? * What about with multiple clients? * Can you front-end it via a load balancer? * Can it guarantee only-one delivery? * How does it handle errors? ie: when a message is retrieved by a client and the client errors after the server dies, what happens to the message - does it redrive or expire correctly when the server comes back up? * How does it guarantee consistency in a multi-node environment? * How dies it behave when a node dies/runs out of memory? * How do you monitor it? * How do you recover a corrupted instance? * what happens if/when the SQLite partition runs out of space?
etc etc.
I use SQS as a main pipeline, and I would want to know a bunch of these things before I'd even consider replacing it. But for someone with one box on a VPS somewhere, you probably only care if it runs for a year without crashing

mihaitodor#
At the very least, I'm guessing this performs better since it's written in Golang.
andrewstuart#
Because SIMPLE.

single exectuable binary
golang with sqlite so fast
minimal config so no ridiculous hours or days of config and operations
This blitzes other ideas for use cases that do not require distributed queues - and that is likely many use cases.

koito171 reply#
I may be asking a naive question, but what is the rationale behind disabling foreign key support and using them anyway in the database schema? See https://github.com/poundifdef/SmoothMQ/blob/46f8b22/queue/sq...

The "TODO: check for errors" comment, combined with what seems like disabling foreign key constraint checks, makes me a bit hesitant to try this out.

memset1 reply#
Good question. It was an evolution. Originally I enforced foreign keys, but inserts/updates were unbearably slow. So I updated the connection string to disable them (but, as you point out, I haven't updated the CREATE TABLE statements.)

In practice, I did not find they were necessary - I was only using foreign keys to automatically CASCADE deletes when messages were removed. But instead of relying on sqlite to do that, I do it myself and wrap the delete statements in transactions.
There are many TODOs and error checkings that I will, over time, clean up and remove. I'm glad you've pointed them out - that's the great thing about open source, you at least know what you're getting into and can help shine a light on things to improve!

plasma#
Some of the slowdown will come from not indexing the FK columns themselves, as they need to be searched during updates / deletes to check the constraints.

Load more comments