Blog: Classier Twitter threads

Better way to manage your Gitlab CI Pipeline ENVs

I often find myself copying AWS access keys from IAM Users to Gitlab’s ENV if I’m automating a deployment for a project or something else. Most of the time, it’s a set-and-forget process, but sometimes you have to go back and investigate, and sometimes you wonder - where did these come from? What are their actual permissions? Who else is using them? Where can I change their permissions? How can I completely delete this user?

Continue reading ...

Consolidating logging in your Java applications

On the surface, logging in Java may appear to be standardized, but there are a few competing standards, which creates problems that we need to address. This article will look into replacing all the unwanted logging libraries with just one.

If you’re looking into how to completely and safely remove Log4j from your projects, this article shows exactly that. I’m not advocating you should do that since you might just be trading a set of known problems for some unknown ones; I’m just saying this is how you can do it if you want to.

Continue reading ...

Database branching (just like with git) in PostgreSQL

Imagine you’re developing a feature, which requires you to do some database schema changes, and those changes might not be backward compatible. But right now, you just want to develop your feature and worry about migrating the production later. You start by writing the code and gradually ALTERing your local database.

But after some time, priorities change. Either the product owner changes his mind and forces you to start working on something else, or there is a critical bug on production that must be fixed immediately. Anyway, you have to switch to master and start working on something else. But you’ve made a mess of your local database because you’ve thought you’d be able to finish this before you move on to something else, and now your master won’t work with whatever is in your local database.

What now? If only you could just magically revert the database to where it was before you’ve started changing the schema.

Continue reading ...

Specialized Value Objects for entity identifiers

You’re probably already using Value Objects daily. Most likely, you’ve come across LocalDate, LocalTime, Instant, URL, Path, … etc. These are provided by the language and are very generic. Maybe you’ve written your own for something like an Email or PhoneNumber, but they’re still relatively generic and can have a lot of use-cases across your codebase, even if they’re specialized for your problem domain.

But, you can also have specialized VOs for single-place use, and there is nothing wrong with that. Thanks to the specialization, you can be extremely strict about the values you’ll allow, and you’re getting a level of type safety you would not get with plain strings or even generic VOs.

Continue reading ...