Bossy Lobster

A blog by Danny Hermes; musing on tech, mathematics, etc.

Edit on GitHub

The Case for a Metadata Table for Database Migrations

Tracking Migrations


As features are added, changed or deleted, the data model used by an application usually changes as well. For most database-backed applications, this means migrations are needed.

With this in mind, the fundamental goal of database migrations:

The current database schema should match the currently running code.

However, achieving …

Edit on GitHub

When Elementary Becomes Elliptic

I enjoy watching math videos targeted at advanced high school or undergraduate students — even if the topics are far away from research level mathematics. I was recently watching a "quick and easy challenge in algebra" video from SyberMath1 that used a neat trick to solve the problem. As the …

Edit on GitHub

Go Duration, PostgreSQL Interval

Building a web application in Go and using PostgreSQL as the database is a real joy. Both of these tools are produced by incredibly vibrant open source projects. These projects represent some of the best attributes of the open source movement. When used in combination, occasionally idioms from Go don't …

Edit on GitHub

Decrypting Vault Ciphertext with a Context

In a previous post, I described a use case for customer provided keys with Vault. One of the implications of this was the need for decryption after a bulk data export. In that post, I gave a concrete example of decrypting Vault ciphertext directly with a customer provided key. However …

Edit on GitHub

Atomically Idempotent

Recently, I was analyzing some initialization code in Go with a teammate. The value being initialized was meant to be used in concurrent Go, so initialization had some requirement of atomicity. The code essentially boiled down to:

func (t *T) Start() {
    if atomic.LoadInt32(&t.State) == Started {
        return // Early Exit …