Go and Postgres Listen/Notify or: How I Learned to Stop Worrying and Love PubSub

Go and Postgres Listen/Notify or: How I Learned to Stop Worrying and Love PubSub
I was reading HackerNews a few months ago and came across this post. It demystified something I’d long wondered about but hadn’t investigated myself: PubSub with PostgreSQL. Most PubSub implementations I’ve seen rely on some sort of message broker like Redis. To be fair, the Redis PubSub interface is pretty easy to work with (I think I have a post or two showing just how easy), and if you were purely working in memory, it would be totally fine. However, most applications rely on some sort of SQL database. In that case, in order to “publish”, you have to write to the database and then notify listeners over your message broker. You end up having to maintain two systems and it’s kind of annoying.
Read more →

Getting Starting with go-redis

Getting Starting with go-redis
Hi. It’s been a while. This post is covering go-redis, which is a popular Redis client for Go. There’s other Redis clients as well as other key-value store backends that you could opt for, but this post is about go-redis. Importantly, this post is not a primer on Redis itself (maybe I’ll have one of those in the future, but this ain’t it). I have a couple use cases in mind that will be the focus of this post:
Read more →