Go, Postgres, Redis, Me

Uniting Go, Redis Cluster Mode, Postgres, and Docker into Something Meh

Recently I was tasked with implementing Redis with Cluster Mode enabled for my company’s production application. One of the nice things about working in the modern software age is that cloud providers abstract a lot of complexity away from you. In our case, we are implementing AWS’ ElastiCache, which supports Redis Cluster Mode natively. However, it’s not so easy to replicate locally. When I set about doing this, what I thought would be a fairly standard Google search. I figured there’d be an immediately available docker-compose file supporting both Postgres and Redis Cluster Mode, but I wasn’t able to find it. As a result, my goals with this post is to create a working proof of concept that utilizes the tools I work with daily and can hopefully be of use to other developers. ...

March 11, 2022 · 8 min · logan
golang gopher up long time

24 hours in Go

(Image credit to quasilyte on DeviantArt) Disclaimer: The code you are about to read is not safe for work. Because it is terrible. It is here if you dare. I've saved off the results in the 24_hours branch. To save some sort of professional dignity, I've made some touchups to the main branch. At my current job, I do a lot less programming that I’d like to. It is no fault of my employer. As an SRE, I am tasked with what is required to get the product moving. At the moment, that is less programming and more of infrastructural work. A lot of my job recently has been configuration, writing YAML, troubleshooting CI/CD pipelines, and interfacing with external teams. As a result, I can feel a few of my programming muscles atrophying. ...

September 7, 2021 · 9 min · logan
Monkey Data

Stocks vs Sports: Stock Data (1.a)

This post is a continuation of Stocks vs Sports. Please see the previous post, Inception, for more context. See all the code on Github. When trying to compare bets made on Wall Street against those made in Vegas, I’ll need data. Lots of data. Look at all of this data! Big data, much data. Very actionable. In order to do anything useful, I need to be able to obtain and store both stock and sports gambling data reliably. In the old days, this would be reading through the sports and finance section of the paper. Nowadays, I’m not even 100% sure that there is a “paper” to read through, so I’m going to be relying on different APIs that can feed data in real time. Recall from my previous post, Inception, that I’ll be using the Alpha Vantage API for stocks, and the Odds API for sports gambling. Testing these APIs is trivial as you can demo them directly on their website. Here’s an Alpha Vantage query with a demo API Key. Here’s the demo documentation for the Odds API. From an initial smoke check, it appears that they’ll fulfill all the needs that I have. In this post, I’ll outline the data generation component of the stocks vs sports system. To keep it simple, I’ll narrow the scope of the data generation to just the “stocks” side. I’ll create a follow-up post with the outline of how the sports gambling data is created. ...

June 21, 2021 · 12 min · logan