Live data from Hacker News

You don't need a database, a queue, a distributed system: Go is enough

simonedutto.github.io

1–10 of 37 posts

Re: You don't need a database, a queue, a distributed system: Go is enough

#6
I don’t disagree with the premise for very small applications, but

> The quiz state machine is full in memory

> The queue system for the matchmaking is in memory

Means those will be nuked as soon as a new version gets uploaded. it really wouldn’t have been much extra work to put this into SQLite as well, and would lead to a much better user experience during updates

Re: You don't need a database, a queue, a distributed system: Go is enough

#7
post #6

I don’t disagree with the premise for very small applications, but > The quiz state machine is full in memory > The queue system for the matchmaking is in memory Means those will be nuked as soon as a new version gets uploaded. it really wouldn’t have been much extra work to put this into SQLite as well, and would lead to a much better user experience during updates

You are right, but i can roll updates during the night without causing any issue. Since after you finished playing you don't have a way to access your old games anymore

Re: You don't need a database, a queue, a distributed system: Go is enough

#8
I am a fan of "distributed computing" - but I do not make it complicated.

I have created a generic broker daemon, which reads messages (in) and places them in the appropriate service (queue) which, at this time, is using sqlite.

Then, a bunch of daemons (workers) connect to the broker service, and processes anything in the queue (process) and tells the broker when the message is OK or errored (output)

I also have commands to check a service queue, active workers, etc.

The broker is generic, simple, and fast. The workers do the actual, specific job.

The communication between the clientbroker and brokerworker is ZeroMQ. There is also a "publish" if you choose to join, which some client programs do.. so they can see any errors on-the-fly.

Installation/deployment is on a linux server using SystemD. Nothing fancy or complicated.

Purpose is that this broker could serve useful for many projects I do in the future.

Post reply on HN