Tag: english

How do foreign keys work in MariaDB system versioned tables?

When I read about the system versioned (and bitemporal) tables in MariaDB, I was both surprised and delighted. This kind of data versioning is thought of as standard in the “immutable” databases that are big in Clojureland, such as Datomic and XTDB. On the other hand, these databases in Clojureland are usually EAVT based and not the “usual” relational kind. After a little thinking I could think of a bunch of really tricky issues that could arise from system versioning (eg having a by-default immutable log of all changes to some piece of data) in a relational context. The first being foreign keys.

If you create a foreign key in MariaDB without any further specifiers, it assumes ON UPDATE RESTRICT ON DELETE RESTRICT, meaning no referenced key could be changed and no referenced row could be deleted. Just consider this: if there’s a row in some table referencing a row in another, system versioned table, can the row in the system versioned “parent” table be deleted? After all the referenced version of the row will still exist… Or in a similar scenario if the “child” row is system versioned and updated to now reference a different row, will both of those referenced rows be RESTRICTed? After all, both referencing rows will still exist… Of course I had to try.

brown-and-white clocks

Hot reloading and reitit in the frontend

Ever since I first ran into the Metosin libraries, I’ve been using many of them. One of the most known and used of those is probably reitit, a routing library that can be used both on the server and in the browser. Recently I’ve had more opportunities using ClojureScript in the browser, and I noticed something that was confusing for a few moments.

closeup photo of fox

Trying FluxCD

When you create a whole FluxCD new setup from zero, it’s really easy: use flux bootstrap. it does “everything” for you. In my case I tried this setup first for last year’s advent calendar. Except back then I had an expedition scheduled for the first half of December, so this took the back seat and was eventually forgotten. Therefore in this year past everything I did back then slowly sank into oblivion, so I again had to start pretty much from zero.

I did set up the repo and a cluster (on Civo) back then, but I quickly tore down the cluster when I realized I wouldn’t be able to test it all out. The repo stayed though, so now i was starting afresh with a k3s cluster spanning three nanodes (that’s a linode referral link with a $100 credit over 60 days) and a repository already set up from last year.

Prometheus vs Longhorn, fight!

Last year I had a brief affair with Longhorn. It’s a tool that abstracts the interface to interact with volumes (in my case in Kubernetes) from where the underlying data actually lives. In my case, my cluster consists of three small nodes, and back then most of the data lived in local-path provisioned volumes. Using local-path means that the data is physically on the host machine instead of some virtually mounted filesystem. This also means that once an application has a PVC, it can’t be assigned to any other node (it results in a “conflict”).

Fuck ads

There are ads that I don’t mind. I’ve multiple times clicked on ads on Facebook and ended up actually buying stuff I’m happily using to this day (trousers, shoes, games…). On the other hand I don’t remember ever clicking on any Google ads, mostly because I adblock everywhere by default so I don’t even see them. On my work machine, where I don’t have adblock, Google ads are just plain stupid so it never even occurs to me.

red fire digital wallpaper

Maybe a new watch

I’ve been using a Garmin Instinct since I got back from Aconcagua, both for training in the gym and running or hiking outdoors. I might need to replace it sooner than later.

Rings of what?

I looked forward to the Rings of Power. A show set in the second age of Middle Earth? There is so much potential. Other than the history textbook outline of the Akallabeth, there’s basically nothing set in stone. There are some characters who are described being kings of regions, founding lordships over thousands of years, but for most of it the second age is a blank sheet where you could make any story you’d want. As long as it doesn’t contradict those historical outlines in the Akallabeth.

So, where do you want to live?

I used to answer “meh wherever,” but things are changing. I have more and more grey hairs in my beard, though people are not noticing because of how light in general my hair is. I’m a bit more desperate about swiping right. I even managed to chip my kneecap in the Karakoram (apparently) which made just walking straight tough for a month let alone climbing stairs (or mountains) (it’s better now). I got addicted to watching house design videos on a certain evil website this time, and that got me thinking and planning.

The Baltoro hike

The hike to Broad Peak (and with a little more hiking, K2) base camp is not a joyride. There are no teahouses, the trail can be pretty challenging and there’s not much variety. That’s why I was very surprised when on the hike in, we met some people hiking out with very light gear around Concordia. Turns out they were there on base camp treks. I knew about such base camp treks to Everest base camp or the Annapurna circuit, but it didn’t occur to me anyone in their right mind would want to hike up the Baltoro glacier just for fun.

Migrating from Docker to Podman

I’ve been eyeing Podman for a while. Being able to build and run containers without the Docker daemon hanging around in the background as an omnipotent demigod sounds nice. Less stuff running = good. Installing it is trivial on Ubuntu (unlike installing Docker): apt-get install podman and it’s done. As the documentation states, it can even be aliased to docker to make migration even smoother. It has tons of features that I don’t think are there in Docker: generating Kubernetes YAMLs from running containers, using container LABELs to make run commands simpler and so on.

Which is all nice and it’s to stay for sure, but I had to realize that at this point this won’t have much of an effect on me (anymore). I hardly ever build container images locally, instead using some CI (Github Actions) to do it automatically. Not having to remember all the build options (even if just in .bash_history) is nice, and if I have to put it into code anyway, I might as well automate it completely.

As for running containers, podman run will be now my go-to for experimentation (instead of docker run). However, most of the time I use docker-compose to orchestrate a local development environment. It’s possible to use Podman’s system service to use docker-compose, but then is there much of a difference from running that and having the Docker daemon running? It’s also possible to use (simple) Kubernetes Pod/Service YAMLs to achieve something similar, and I’ll be sure to consider that the next time. But I don’t think I’ll make the effort to change these stuff for existing projects on my current computer. Not unless Docker kills free users altogether…