SmartEnum for better domain modelling

An enum is a simple value that has no logic on it’s own. It is usually used to note a type of something. However, because they can not contain any logic, we end up poluting our domain with many if-else…

Querying database with non-covering index

When writing a simple query, we often check if there’s an index for all the fields we filter on. The query performs well in both local and production environments, and we don’t think twice about it. However, certain conditions can…

Scaling a notification service, Part 3 – Horizontal scaling

In the previous part, a multi-threaded solution was created, that does not scale. Partitioning was used to split the data into smaller data sets each thread would process. The next milestone is to create a scalable solution.When talking about scalability,…

Scaling a notification service, Part 2 – Multithreading

In the previous part, we created a simple, single-threaded solution that does not scale. The CPU utilization was around 1%. We can improve this by creating multiple threads until the CPU hits the 100% mark. Note that does not mean…

Scaling a notification service – Part 1

A reader reached out and asked for advice on how to create a notification service. In this series of posts, I will try to answer the question, but also the reasoning behind different approaches. We start from a simple approach,…

Reduce cognitive load with abstractions

Developers work with complex systems. Each of those systems is complex on its own, and the interactions between them can become complex as well. One way to deal with the complexity is to abstract those systems. We don’t need to…

Competitive Advantages of OOP and FP – A Reader question

An interesting question popped up in my inbox: Are there any competitive advantages on using functional programming or programming style over usual programming in .NET API Programming? Advantages in terms of performance and optimisation. There are two distinct questions here.…

Using Locks

Locking – What is it, how and when to use it? The answer is: Hopefully, you dont. Quite an artist, right? The nature of locks is to limit concurrency in software. Meaning, we are introducing waiting time, where the CPU…

AsNoTracking – A Reader question

I’ve received a question from a reader (thanks Ishthiyaque Ahmed | LinkedIn!) about EFCore AsNoTracking performance. The question contains an image of a BenchmarkDotNet table result: Question text: The code being tested shows loading from database N number of blogs,…