Live data from Hacker News

Show HN: Drop-in SQS replacement based on SQLite

github.com

31–40 of 171 posts

Re: Show HN: Drop-in SQS replacement based on SQLite

#31
post #2

SQS: Amazon Simple Queue Service

Thank you, I was scratching my head trying to figure that out.

Why some people think we need AI everywhere to "augment" and "enrich" our "experiences".

People don't bother a google search, after, what, 20 years in town?

Re: Show HN: Drop-in SQS replacement based on SQLite

#32
post #21
post #19

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.

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?)

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.

Re: Show HN: Drop-in SQS replacement based on SQLite

#33

Actually pretty excited to try this, there are so many cases where I need a bare-bones (aka "simple"), local, persistent queue, but all the usual suspects (amqp, apache whatever, cloud nonsense, etc.) are way too heavy. I'll probably try poking at it directly through the HTTP API rather than an SDK ... does it need AWS V4 auth signatures or anything?

The only HTTP API that is exposed is actually the SQS one. (I'm not opposed to a "regular" HTTP API but the goal was to make it easy for people to use existing libraries.)

If you do use your language's AWS SDK, the code handles [1] all of the V4 auth stuff. https://github.com/poundifdef/SmoothMQ/blob/main/protocols/s...

I'd love your feedback! Particularly the difficulties you find in running it, of which I'm sure there are many, so I can fix them or update docs.

Re: Show HN: Drop-in SQS replacement based on SQLite

#34
Could you elaborate why you didn't choose e.g. RabbitMQ? I mean you talk about AMQP and such, it seems to me, that a client-side abstraction would be much more efficient in providing an exit strategy for SQS than creating an SQS "compatible" broker. For example in the Java ecosystem there is https://smallrye.io/smallrye-reactive-messaging/latest/ that serves a similar purpose.

Re: Show HN: Drop-in SQS replacement based on SQLite

#36

Actually pretty excited to try this, there are so many cases where I need a bare-bones (aka "simple"), local, persistent queue, but all the usual suspects (amqp, apache whatever, cloud nonsense, etc.) are way too heavy. I'll probably try poking at it directly through the HTTP API rather than an SDK ... does it need AWS V4 auth signatures or anything?

I'd also give a shout out to beanstalkd. I use it to teach message systems and it's great.

Re: Show HN: Drop-in SQS replacement based on SQLite

#37
post #8

Earlier quoted context omitted.

I'm using WAL mode - I'd almost given up on sqlite until I remembered to enable it. I've been playing with benchmarks, yes! I haven't written them up yet because I worry about doing them the "right" way. but since you asked, I did a quick test with a single server and single client on a t2.nano. With 3 sending threads and 5 receiving threads, and mesg size of 2kb, I can send 700 msgs/s and receiver 500 msgs/s. It is…

You might need dedicated resources, including storage speed guarantees, to get reproducible benchmarks out of a cloud provider. Love the red sweater btw very classy yet simple

That sweater is one of my favorite items, thank you :)

The goal is for this to be able to run well on commodity hardware, which I think is possible. If I can run this on $platform with $cheap instances and an $autoscaler then that would be my ideal design goal because I think it matches the setup that most people have access to.

However, I agree - I am a big fan of Hetzner's servers and am excited to try out benchmarks on beefier hardware too.

Re: Show HN: Drop-in SQS replacement based on SQLite

#38
post #8

Earlier quoted context omitted.

I'm using WAL mode - I'd almost given up on sqlite until I remembered to enable it. I've been playing with benchmarks, yes! I haven't written them up yet because I worry about doing them the "right" way. but since you asked, I did a quick test with a single server and single client on a t2.nano. With 3 sending threads and 5 receiving threads, and mesg size of 2kb, I can send 700 msgs/s and receiver 500 msgs/s. It is…

I had to build a queue implementation not too long ago. We used t2.nano for our benchmarks as well. Your results are in-line with ours pre-optimizations (except we are using nats jetstream for queuing). I’d also recommend reducing the number of threads as that can increase performance on single-processor machines (context switching will kill you). Try to find the sweet spot (for us, it was 2x-4x the number of cpus to…

These are great suggestions. Today every db write is indeed wrapped in a mutex. The two optimizations I am experimenting with are:

1. When new messages are inserted, immediately append to a file on disk. Then, in batch, insert to SQLite.

2. When dequeuing messages, keep n message IDs in memory as a ready queue, and then keep dequeued message IDs in another list. Those can be served immediately (using a SELECT which is fast) and then updating messages to the dequeued status can happen in batch.

Appreciate the tips!

Re: Show HN: Drop-in SQS replacement based on SQLite

#40

The goals are a little different but I think it's worth pointing out ElasticMQ. I use it simulate sqs in a docker environment. https://github.com/softwaremill/elasticmq

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/
Post reply on HN