Andrew Klotz

BlogProjectsBooks

Bitboards in Chess Engines

17 June 2024

The first time I came across bitmaps was when I was looking into writing a chess engine. A chess board is 64 squares in a 8x8 grid. The…

Mock filesystem for easier unit testing

07 June 2024

Using a mock filesystem can help reduce test flakiness and speed up tests. A regular filesystem introduces two problems for tests. The first…

Feedback triggers

19 August 2023

It can be hard to accept feedback. Feedback typically involves information about us that we might not want to hear. I have sometimes found…

Three types of feedback

19 August 2023

Giving feedback is a thing we are supposed to do often, and ideally be good at it. Feedback used to be a thing I had though as a dial to be…

Service Granularity, Disintegrators

11 June 2023

How do you go about deciding how big services should be when using service oriented design or micro-services? Software Architecture the…

Setting up go with Bazel

11 June 2023

Bazel is an open-source build system created by Google, that can provide fast builds for Go projects though incremental builds and remote…

What values should live in a golang request context?

25 March 2023

Contexts in Go live for the duration of a request and can contain an arbitrary set of values. This can be convenient because frequently used…

Instrumenting bash scripts

06 February 2023

Tracing gives a detailed breakdown of where time was spent, typically an HTTP request. We can do the same for shell scripts. If you find…

Dependency metrics for architecture improvements

01 January 2023

Dependency metrics for architecture improvements We can use dependency metrics to design our code to be built and test faster. As a codebase…

Parallel bash with wait

20 August 2022

Parallel processing in bash is easy with the command. There is a small gotcha to watch out for. To use it will wait until all child…

Concurrent writing to slices in GO

06 July 2022

Can you concurrently write to slices in GO? The short answer is yes. The Language Specification for GO describes different behavior for…

Smallest Golang Docker Image

20 March 2022

We are going to be building 3 docker images in search of the smallest Golang docker image. A while back I reduced the size of a Golang…

Building an Actions Per Minute counter - part 3, Data structure

06 February 2022

This is part 3 of a 3 about creating an Actions Per Minute (APM) tracker for playing video games on windows. Part 1, Keylogger Part 2, UI…

Building an Actions Per Minute counter - part 2, UI

06 February 2022

This is part 2 of a 3 about creating an Actions Per Minute (APM) tracker for playing video games on windows. Part 1, Keylogger Part 2, UI…

Building an Actions Per Minute counter - part 1, Keylogger

06 February 2022

This is part 1 of a 3 about creating an Actions Per Minute (APM) tracker for playing video games on windows. Part 1, Keylogger Part 2, UI…

Toyota Production System Principle - go and see for yourself

22 December 2021

If you sit with an engineer and ask them to show you their commit-to-production workflow, it is staggering how tolerant engineers are of…

Strategy for Scaling a Platform Team

25 October 2021

A growing software department usually means creating a dedicated ‘platform team’ to take care of the non-feature components, but what should…

Survivorship Bias and Organizational Scar Tissue

10 October 2021

How do organizations end up with so many rules that get in the way of getting work done? Well-intentioned decision-makers are often victims…

Leveling up with Engineering Career Ladders

02 October 2021

Leveling up in video games is easy. As a gamer, I often wish more things like career improvements could be as easy as playing games and in…

Building CloudLeaderboard

19 September 2021

This is a write-up of a small SaaS app cloudleaderboard.com I had built, deployed, marketed, and since shut down. In my professional career…

Capability Maturity Models

08 September 2021

Meetings are generally not good in startups. This is not because meetings are inherently bad, but the organization processes around meetings…

FAST beats SMART in startups

07 September 2021

A SMART goal if you are not familiar is an acronym that stands for: specific, measurable, achievable, relevant, and time-bound. The purpose…

Five levels of ownership

21 August 2021

This is based on the talk ”Mistakes and Discoveries While Cultivating Ownership” by Aaron Blohowiak What is ownership? Ownership is a shared…

Monitoring microservices with the RED method

08 August 2021

The RED method is a set of three metrics, Requests, Errors, Duration, that act as a good place to start for monitoring our microservices…

Inject build-time variables in Golang

07 August 2021

With Golang we can inject build-time variables into our binary. This can help provide users with a quick way to gather more information…

Systemd Hellod World

26 June 2021

Coming from a world of containers managed by Docker, systemd lets us do that for binaries on a host. We will be setting up a small webserver…

Engineering Strategy 5x5

09 June 2021

The idea for a 5x5 method for coming up with an engineering strategy in Write five, then synthesize - which I recommend reading. The gist is…

Space and accuracy tradeoffs with bloom filters

29 May 2021

We can make significant gains in space efficiency by reducing our accuracy from exactly 100% to approximately 100%. Most data structures I…

Hiring and the Four Stages of a Team

27 May 2021

If multiple teams are struggling and need hires but you don’t immediately have hires for all of them, what do you do? I was in a situation…

Passing the Postgres 65535 parameter limit

15 May 2021

If you are doing bulk inserts into Postgres you may have hit a message like this , You may be tempted to rewrite your query into chunks and…

11 Laws of Software Engineering

02 May 2021

1) Hoots law https://blog.boomsupersonic.com/the-astronauts-guide-to-problem-solving-5eafdca29fd7 No matter how bad things are, you can…

Leverage points and feedback loops: doing more with less

01 May 2021

A pattern I have observed in projects falling behind is not a lack of output - but a lack of desired output. For example, a team is working…

Data Autonomy in Microservices

10 April 2021

Will microservices sharing a database prevent them from being autonomous? If you are not sure, then the answer is most likely yes. The…

Key metrics for microservices architecture

03 April 2021

Effective monitoring for microservices requires an architecture that extends beyond the success rate of incoming HTTP requests. Coming from…

Building consensus in engineering

28 March 2021

An inefficient meeting taught me a lesson about leadership and building consensus. There was a change I wanted multiple other teams to adopt…

Making your first kernel module

20 March 2021

Linux kernel modules are pieces of code that can be loaded and unloaded into the kernel without rebooting the system. Running code inside…

Using the go heap interface

07 March 2021

Go provides support for heaps as part of the language. What we have are interface and module methods, these can be a little intimidating if…

API Health checks for graceful or cascading failure

19 February 2021

Its 2 AM alarms are going off that your microservice system, designed to be resilient to failure is now failing. After looking at your…

Building a Dactyl Keyboard from scratch

01 February 2021

Originally I was looking at buying one from OhMyKeycaps but after spending some time in Reddit ErgoMechBoards I decided this would be a fun…

Tactical advice for effective meetings

24 January 2021

A single question to improve the overall quality of meetings: Is a decision needed?. If ‘no’, then consider alternatives. If ‘yes’, then…

Manager Readme January 2021

11 January 2021

My hope is that this answers a few questions about my thought process and adds a set of conversation starters. This does not replace getting…

Presentations and effective communication in the age of Slack

10 January 2021

Presentations are sometimes inadequate ways to communicate information. Introducing information for the first time verbally and without a…

Manging improvements in increments

03 January 2021

It is easy to jump into a new project and either accidentally fail by trying to change everything at once. The better strategy is to make…

Farming for dissent

30 December 2020

A good habit for the success of large projects is getting ‘buy-in’ or alignment from peers prior to starting. One of the challenges is that…

Serverless Lambda Twitter Bot Cron

13 December 2020

We need a quick way to set up a daily job that will be posting to Twitter. Today is the day we use serverless.com and see how fast it is to…

Posgres per-table autovacuum management

02 December 2020

You need to tune Postgres auto-vacuum settings, but per-table can be hard to manage. Postgres auto-vacuum and auto-analyze settings are…

Engineering Culture: Catchphrases and Quotes

23 November 2020

Catchphrases can create vivid and memorable scenarios that act as heuristics for behavior and decisions. In The Culture Code, Daniel Coyle…

BPF intro: syscall counting

19 November 2020

After watching a talk on eBPF Superpowers, I wanted to give writing a program myself a try. Thanks to BCC BPF is pretty easy to get started…

OKRs hierarchy: example for a MVP

12 October 2020

OKRs hierarchy: how do you set goals and keep alignment from company to department?

Quickly debugging Postgres problems

15 August 2020

Uh-oh! something just happened One of these queries might quickly narrow down a problem with your Postgres database. With a little luck, the…

Easy EC2 SSM with Pulumi in Typescript

28 May 2020

After watching this talk from Luke Hoban, I wanted to give it a spin. Hoban’s analogy of current tools as Assembly language of the could…

Speeding up json processing in go

17 May 2020

We will be speeding up our JSON processing by 11x with a few tricks: reusing allocated memory the Flyweight pattern JSON parsing without…

Compression with Brotli CGO in Alpine Docker

22 April 2020

Both Uber and Lucidchart have detailed breakdowns of gains by compressing JSON payloads and I wanted to give high compression a try with…

Deploy an EC2 to run Docker with Terraform

18 April 2020

So you have a Docker container running locally and you want to run it in the cloud. Terraform makes it easy to quickly set up the cloud…

Object Fingerprinting for Efficient Data Ingestion

25 March 2020

We are going to cut our write payload down by 95% for our very specific example. What happens when you frequently receive a payload for an…

Docker dynamic environment variables

15 February 2020

You might have a use case to dynamically add environment variables to docker containers. If you have ephemoral hosts and using something…

TLA+ verifying a money transfer

07 December 2019

What could go wrong with transferring money between two accounts? I have written about how easy it is to get wrong (giving away or losing…

Rust, wasm, and tetris

17 November 2019

WASM has been making a lot of progress recently so I was looking for a small project to run through and tetris with rust came to mind. Its…

Screenshot Blur as Lockscreen on OSX

22 October 2019

Take a screenshot, blur it, and use it as the screensaver with a little lock icon on top.

Insert speed and Postgres indexes

17 October 2019

Adding too many indexes has a cost, we are going to run through some example data and what size of an impact it looks like A common rules of…

Web authorization with Casbin

16 August 2019

Casbin is an authorization library that supports ACL, RBAC, ABAC permissions on resources. If you are not familiar with those terms, we will…

Imagining better flaky test management

30 June 2019

If we imagined better tooling around managing flaky tests what could we come up with? One thing I have noticed in working with polyglot that…

Web authorization with Open Policy Agent

28 April 2019

So maybe you upgraded our authentication logic to no longer be a system bottleneck but now find authorization slowing you down, or have…

Golang custom error types with stack trace

28 April 2019

Golang error handling is fun because it is a first class citizen in the language, but the built in behavior is bare bones. But there are two…

What does an effective team look like

17 April 2019

If you are building an effective team, do you know what you are building towards? Is it more than just putting smart people in a room…

What makes a great engineering manager

26 March 2019

‘What makes a great engineering manager?’ This is a question that I get asked a lot by both new and experienced managers. On the new manager…

4 Types of work

23 March 2019

If you find yourself doing lots of work constantly but seemingly unable to get the things done that you planned to, categorizing work may…

Effective coaching

28 January 2019

There is a really good chance you are not getting effectively coached, and you are not giving effective coaching. Has a peer come to you…

gke ssd helm

28 January 2019

By default GKE does not use SSD for Persistance Volumes (PV), which is a little annoying since that is usually what I am looking for. I…

Golang finding memory leaks

29 October 2018

We are going to look at finding memory leaks in golang using a tool called pprof. As a quick refresher, a memory leak is when an application…

Container from scratch

12 September 2018

We are doing to be building a docker from scratch, and I do not mean a Dockerfile from scratch, I litterally mean the container. Getting…

Declarative Programming with Prolog

11 February 2018

Prolog is a declarative language around logic programming, where we can specify the rules and facts of a problem and let the language…

Lost messages with sidekiq

28 January 2018

Sidekiq is a great library for getting asynchronous library for quickly moving work into background jobs in Rails/Ruby apps, but it can drop…

Debugging slow PostgreSQL queries

04 January 2018

If production is on fire from slow queries, the quick command to identify them is: The above command will output any queries that have been…

Graph queries with Cypher in Neo4j

03 January 2018

Neo4j uses a declarative language called Cypher, that lets us easily make graph style queries that return some pretty cool data. We will be…

Neo4j bulk data import

01 January 2018

Neo4j has a csv import tool that makes importing large datasets pretty easy, especially if you happen to be exporting data out of postgres…

Building a Leaderboard with Redis

24 December 2017

Leaderboards can be cumbersome to build, especially building one that can scale past millions. Fortunately Redis has built-in data type that…

PostgreSQL pivot tables, selecting has-many relationships

16 December 2017

PostgreSQL has a useful function called that makes selecting ‘has many’ data associations pretty easy. In our example we have contacts who…

Preventing RabbitMQ dropped messages with an Outbox

10 December 2017

If you have dropped messages after introducing RabbitMQ (or another messaging tool) then this is for you, a quick example on the most common…

Interactor Pattern: Keep your rails app skinny

23 May 2016

Ever struggled with where where to stick your Rails app logic? or had controllers and models getting big? When I first started with rails…


Andrew Klotz

Written by Andrew Klotz. Building tools to help people to do their best. You should follow him on Twitter