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.


大子

大子行ってきたぞ!大子を知った経緯は、一昨年那須行ったときに温泉むすめの等身大パネル見て帰ってサイトで他のどんなのあるかなと調べたら大子を見つけた。それと完全に別でヤマップで「茨城ジャンダルム」登った人の記録もみた。どうやらジャンダルムの天使に会うなら穂高だけじゃなく、茨城の生瀬富士のジャンダルムでも会える。そしてさらに、あるSNSは俺に向けた広告はビール、服、ワーケーションばっかり。そのワーケーションの広告で同じ茨城県北のOKUKUJI BASE CAMPというキャンプ場を知った。さらにさらに近くに袋田の滝という、日本三名瀑の一つの観光スポットもある。つまり温泉もあっておもしろそうな山もあって、観光地もあって、日中は仕事もできるキャンプ場まである。行くしかない!