RSSAmplifier

Blog

Coding Militia

Recent content on Coding Militia

blog.codingmilitia.comRSS feed ↗159 posts

Latest posts

Funny, but not so funny, Buy Me a Coffee story

Well, this is a different and unexpected post, with a story of I what I can only describe as carelessness and incompetence at Buy Me a Coffee

[Video] On .NET Live - Shaving the outbox pattern yak

Got the chance to talk about the transactional outbox pattern “On .NET Live”, sharing the recording here if anyone’s interested.

Sometimes it's just better to load "all" the data

A quick post on adapting your approach to the problem at hand, not just following the same ideas indiscriminately.

On professionalism, professional pride, career and ambition

An half-rant, half-reflection on the importance of professionalism, taking pride in one’s work, and the role of ambition in career growth.

Adopting Problem Details for HTTP APIs

Time for a quick post about Problem Details, and how we adopted it at work, in a way that’s actually useful.

How I've been building APIs and microservices lately (feat. C# & .NET)

This post is all about how I’ve been building APIs and microservices lately (using .NET and C#), what’s been making me productive, and how my approach has evolved over time.

Kubernetes API powered resource discovery (feat. K8s C# client)

Have you ever felt the need to automate the discovery of some information within a distributed system? Turns out, the Kubernetes API makes it surprisingly simple to do so.

Care about the domain, not about implementing all the patterns and principles under the sun

Time again for a rant adjacent post, on this occasion, about building applications following some domain-driven design ideas.

Introducing OutboxKit

After talking about the outbox pattern so much, and implementing it from scratch a few times in a few different projects, finally figured it was high time for me to build something I could reuse.

Keeping an eye on cache hit ratio (feat. FusionCache, OpenTelemetry & friends)

In this post, we’ll take a very quick look at how to use the awesome FusionCache library, and how to observe its impact on our services.

Testcontainers and Podman

Spent way too much time trying to get Testcontainers to work with Podman, to find out I just needed to set a flag 🙃.

Transactional outbox pattern meets distributed tracing and OpenTelemetry

Transactional outbox pattern and distributed tracing doesn’t seem like having much in common, right? This post describes how they intersect and a possible approach to get them working together nicely.

Where are my traces? (weird .NET meets OpenTelemetry gotcha)

Quick post about a weird gotcha I found when using distributed tracing with OpenTelemetry .NET, in a system where not all services have otel setup

Primitive vs strongly typed dictionary keys (feat. frozen collections and BenchmarkDotNet)

Quick post comparing the usage of different types as dictionary keys, including using custom types instead of only primitive types.

A .NET parallel Kafka consumer proof of concept (feat. Akka.NET and the actor model)

For some time now, I’ve been thinking about implementing a parallel Kafka consumer proof of concept in C#. I finally got around to it, and this post describes the process.

Byte array as a dictionary key? Trying out some options

Using arrays as a dictionary key is not really something very common, but I had the need for it, so did some investigation to try and figure out a good way to do it.

Observing .NET microservices with OpenTelemetry - logs, traces and metrics

Observability has been one of the hot topics, with the increasing complexity of knowing what is going on in our applications. Fortunately, .NET has been investing in making things easier with OpenTelemetry.

"Parse, don't validate" and other type safety driven shenanigans (plus a C# wishlist)

Making use of the type system is something I feel should be important when working in a strongly typed language like C#. However, I don’t feel like that’s the case, and I would love for the language to push folks in the direction of creating more robust programs, where the compiler provides more help in proving the correctness of the code.

Enforce conventions (but don't go overboard) with architecture tests

I’ve been trying to flee the over-engineered C# solution structures, with multiple projects, with related code scattered around. Even if an imperfect solution, I’ve turned to NetArchTest to help in guide on following some conventions in a simplified solution structure.

From domain events to infrastructure - thinking out loud about possible approaches I don’t hate

On the topics of domain-driven design and event-driven architecture, something that’s been on my mind for quite some time, is the process of handling domain events, as well as potentially translating them into integration events.

Checking out EF Core inheritance options

Recently there was a need to use a hierarchy in a domain model, and there was a question about which of the available approaches to use - table per hierarchy (TPH), table per type (TPT) or table per concrete type (TPC). This very brief post is just a quick look at some benchmarks I created on the subject.

A reminder to consider that your context, isn’t the only context (.NET 8 TimeProvider edition)

This will be a very brief post, just as a reminder that we need to give things a good thought, trying to limit our biases (I’ll focus on software development, but it’s applicable to everything really).

Contract first OpenAPI development (but still use Swagger UI with ASP.NET Core)

In C# and .NET land, we’re pretty heavy on the code first approaches, with the odd exception. Let’s take a look at a possible contract first approach to API development, with OpenAPI, but still taking advantage of existing tooling that we’ve come to rely on, like Swagger UI.

Mapping ASP.NET Core minimal API endpoints with C# source generators

I’m pretty late to the C# source generator party, but hey, better late than never 😅. In this post, let’s take a look at how we can automagically map minimal API endpoints using C# source generators

The “insert specific tech here” developer: yay or nay?

The boxes developers put themselves into is something I’ve given some thought over time. Probably not something folks think about much, but figured I’d write a post about it anyway.

On résumé-driven development, FOMO and dismissing it

I’ve had some of thoughts not exactly résumé-driven development, but more importantly, how engineers, can remain up to date and relevant in the job market, and a recent discussion on LinkedIn reminded me about it.

Beware of records, with expressions and calculated properties

I’ve been using C# records a lot since the feature was introduced. However, when using them, we really need to understand how they work, otherwise we might face unexpected surprises.

[Video] Outbox meets change data capture - hooking into the Write-Ahead Log (feat. .NET, PostgreSQL & Kafka)

Another video on using change data capture (often referred to as CDC), to hook up into the database transaction log, forwarding incoming entries to the outbox table.

[Video] What's the point of async/await in an ASP.NET Core application?

I’ve been noticing in recent chats that folks have difficulty explaining why do we use async/await, tasks and related, when building ASP.NET Core applications.

[Video] Quick shout-out to DevToys

Wanted to very briefly share a tool I’ve come across a couple of months ago: DevToys.

[Video] Polymorphic JSON Serialization (feat. .NET & System.Text.Json)

Time for one more video on messing with System.Text.Json, this time to get polymorphic (de)serialization going.

OpenAPI extensions and Swashbuckle

Let’s take a quick look at OpenAPI extensions (which I discovered were a thing last week 😛) and how to add them to our API description using ASP.NET Core and Swashbuckle.

Array or object JSON deserialization (feat. .NET & System.Text.Json)

Ah, the joys of integrating with third-party APIs… We always end up having to hammer something to get things working 🤣. This is a post about one of such situations, resorting to some JSON deserialization trickery (via JsonConverter) to be able to get things working.

[Video] Outbox meets change data capture (feat. .NET, PostgreSQL, Kafka and Debezium)

Quick video with an interesting approach to implement the publisher part of the outbox pattern. Using change data capture (often referred to as CDC), we hook up something to the database transaction log, forwarding incoming entries to the outbox table. In this example, we’ll make use of Debezium, hooked up into a PostgreSQL database, forwarding messages to Kafka.

Getting a complex type as a simple type from the query string in a ASP.NET Core API controller

This is a tale of a good amount of hours of wasted time, so I’m going to document it so I remember it in the future. The idea is simple: when building an API, how can we treat a complex type as a simple type, to avoid things like primitive obsession, implement strongly typed ids and other related patterns? Let’s find out! 🙂

[Video] High-performance and compile-time logging source generation in .NET 6

Quick little video about an interesting new logging related feature coming in .NET 6, compile-time logging source generation, as well as related high-performance logging features, which were already present but probably not very well known.

[Video] Exploring distributed tracing with ASP NET Core 6

Distributed tracing isn’t a new subject by any means, but there are some more recent developments, namely in terms of standards like W3C Trace Context and OpenTelemetry, that are worth a look.

[Video] Are ASP.NET Core Minimal APIs just for demos?

The upcoming release of ASP.NET Core 6 brings a pretty interesting feature set referred to as “Minimal APIs”. While they seem pretty interesting to me and many others, some folks are not fans and can be quite vocal about it, so I thought about taking quick look, put things in perspective, as well as compare with other tech stacks.

Next level console apps with Spectre.Console

Don’t know about you, but when I build console applications, pretty is not a word I use to describe them. Let’s see how Spectre.Console can help us with that!

Mistaking software for a finished product

As much as it would be simpler, software isn’t something we can ship and forget about, or even just keep adding features without revisiting architecture and design.

Virtual as a code smell*

Lately I noticed I’m essentially treating virtual methods as a code smell, so thought it could result in an interesting blog post.

Setting up demos in Azure - Part 2: GitHub Actions

Building on the work from the previous post, in this one we make use of GitHub Actions to setup workflows for easy setup and tear down of a demo environment in Azure.

Setting up demos in Azure - Part 1: ARM templates

As I’m preparing some demos using Azure services, wanted to have things in place so I can easily setup the whole environment. In this first part, we look at using Azure Resource Manager (ARM) templates to get all those services up and running.

Streamlining package versioning with MinVer

In the past two posts on the path to publish a NuGet package, we started by setting up the build with NUKE and running it with GitHub Actions. Before we get to the actual publishing part, there’s one more thing we need, which is to handle versioning.

Getting started with GitHub Actions

In a previous post, we started to prepare the build pipeline for a new library, using NUKE. In this post, we’re going to continue that work, setting up continuous integration, running the build with GitHub Actions when changes arrive.

Going all-in with nullable reference types

I know I’m late to the party, but just recently had the opportunity to start using nullable reference types more seriously, so thought of gathering the first steps taken to go all-in with it.

.NET Conf 2020 and .NET 5 links

.NET Conf 2020 is done and .NET 5 is finally here! Information about this release is spread across a bunch of blogs, videos and whatnot, so I thought of grabbing a bunch of links and put them in a post for quick reference.

Setting up a build with NUKE

Let’s take a look at NUKE, a cross-platform build automation system with C# DSL. We’ll use it to define the build for a new library that will eventually make its way to NuGet.

Shaking things up a bit - ASPF02O Outro

Almost two years have passed since I started the “ASP.NET Core: From 0 to Overkill” series. It’s time to shake things up a bit 🙂.

Some comments, tips and rants about my path to Kubernetes certification

Sharing my experience about my path to learn about Kubernetes and prepare for the Certified Kubernetes Application Developer (CKAD) exam.