.NET R&D Digest (November, 2020)

Today is Monday. Today is the last day of Fall. Today is just the right time for a new issue of .NET R&D Digest 😊

This issue includes bits of software development, .NET, .NET internals, Visual Studio, Cloud and a bit of fun in the watch & learn section.

Have a nice day and enjoy your reading!

Software Development

  1. Consistent Disaster Recovery for Microservices: the BAC Theorem (by Guy Pardon and Cesare Pautasso)
    Backup is an essential part of any modern application (or at least should be!). However, when it comes to distributed systems creation of consistent backup becomes much more complicated. In this paper Guy Pardon and Cesare Pautasso discuss the tradeoff between the availability and consistency of a microservice-based architecture, when the backup of the entire system is being performed.
  2. Feature Toggles (aka Feature Flags) (by Pete Hodgson)
    Application development is a continues process during which we introduce new features and refactor existing ones. We also want to be sure that these activities won’t introduce problems but value. This is where feature flags comes into play. In this post Pete Hodgson describes use cases when feature flags can be of use and demonstrates various examples of how to implement them in code.
  3. Don’t Compare Averages (by Martin Fowler)
    What is the most obvious way to compare two groups of numbers? In most cases it is to compare their averages. However, this approach won’t work in many cases. In this post Martin Fowler describes the problem of using averages to compare groups of numbers and explains what statistical method could be used to provide more insights about comparing data. The post is full of graphs and near real life examples.
  4. Improve your tests with Assert Object Pattern (by Dawid Sibiński)
    Writing clear and easy to understand unit-tests is complicated. It depends on many factors (including how friendly the code we are testing is for being testing). In this post Dawid Sibiński describes a simple but yet powerful “Assert Object” pattern which can help in writing more clear unit-tests in situation when test has many asserts or the assert logic is sophisticated.

.NET

  1. How to write your own commands in dotnet-dump (Part 1 and Part 2) (by Christophe Nasarre)
    As a software developers we use many tools to do our job. These tools are usually great, but not almighty, so sometimes we need to implement new command ourselves in form of external application or script. But, is it possible to extend the tool itself? Sometimes 🙂 In these posts Christophe Nasarre describes his experience working with Microsoft diagnostics team to extend dotnet-dump tool with command he and Kevin created at Criterio. These posts include commands descriptions and detailed explanation of how external commands are written to be integrated into dotnet-dump.
  2. Investigating an InvalidProgramException from a memory dump (by Kevin Gosse)
    InvalidProgramException is a rare citizen in general .NET applications. However, even if you generate IL on the fly and you know about this, debugging InvalidProgramException is still a mess even in your own source code. Now imagine doing this without source code 🙂 In this series of three posts Kevin Gosse switches job difficulty to hardcore and debugs random occurrences of InvalidProgramException without source code, just with memory dump. The posts are very detailed, Kevin lists all commands he used and highlights all important outputs from tools, which makes it interesting, easy to read detective story.
  3. ASP.NET Core Health Checks (by Jürgen Gutsch)
    If we look at application health, we can say that: app is working fine, app is lagging or app isn’t working. We as humans can interpret application response and distinguish errors from success. But what caused the error? Is application performance is degraded? These questions are much more harder to answer. In this post Jürgen Gutsch does a great explanation of Health Check functionality in ASP.NET Core and how they can be used to share application status with other services, provide detailed application status to application administrators and use application status in code to improve availability. The post is full of code snippets and links to packages and projects which might be helpful when developing your own health checks.
  4. Task, Async Await, ValueTask, IValueTaskSource and how to keep your sanity in modern .NET world (by Szymon Kulec)
    Starting from the moment when Tasks were introduced in .NET 4.0 the asynchronous infrastructure has evolved tremendously in both functionality (async-await introduction) and performance. In this post Szymon Kulec goes through all these changes, highlighting an idea behind each of them.

.NET Internals

  1. Virtual Stub Dispatch
    Have you ever wonder how virtual interface dispatch is implemented in .NET? If yes, then this page of BOTR (Book of the Runtime) is what you need to find out. It is hard and not easy to get from the first time but the described ideas is very interesting and definitely worth reading. In case you are interested in how methods are dispatched I also recommend you to read these posts (first, second) by Lukas Atkinson and this post about stubs by Matt Warren.
  2. .NET internals: System.Threding.Channels – UnboundedChannel<T> (by Steve Gordon)
    Producer-consumer is a very popular application scenario, however, it is hard to implement right from the performance point of view, especially, when there are many writers and readers. That is why .NET Core 2.1 introduced a special set of classes – channels but how these channels are implemented? In this series Steve Gordon dives into implementation details of UnboundedChannel<T> class explaining how it works and how it attempts to optimize allocations in some of corner cases. These posts are full of code snippets and easy to follow.

Cloud

  1. Collect and Automate Diagnostic Actions with Azure App Services (by Reed Robison)
    Collecting diagnostics information is a critical part of application’s life. This information can be collected manually or automatically depending on service used to host the application. In this post Reed Robison describes how you can collect diagnostics information from an application hosted using Azure App Service. Reed describes both how to do it manually and how to configure Azure rules to do this automatically in certain circumstances.

Watch & Learn

  1. Deep dive into diagnostics in .NET 5 and beyond… (by Mark Downie, Christophe Nasarre and Konrad Kokosa)
    Application diagnosis is usually a complex and time consuming effort, especially if we are talking about diagnosis of remote or live applications. That is why having right instruments is critical. In this “webinar / Q&A session” Mark Downie, Christophe Nasarre and Konrad Kokosa talk about latest diagnostics related improvements in Visual Studio (how you can now utilize Visual Studio to dig into memory dumps taken from application running on Linux on Windows machine) and .NET 5 (new tools and scenarios they cover).
  2. The Art of Code – Dylan Beattie (by Dylan Beattie)
    Usually I write some introduction to every link I include into the issue. However, this presentation by Dylan Beattie can’t be described by a few words 🙂 If you are interested in how code can be used, then this presentation is definitely for you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s