skip to content
Relatively General .NET

RavenDB 6.0: Sharding webinar

by Oren Eini

posted on: January 09, 2023

This Wednesday I’m going to be doing a webinar about RavenDB & Sharding. This is going to be the flagship feature for RavenDB 6.0 and I’m really excited to be talking about it in public finally. Sharding involves splitting your data into multiple nodes. Similar to having different volumes of a single encyclopedia. RavenDB’s sharding implementation is something that we have spent the past three or four years working on. That has been quite a saga to get it out. The primary issue is that we want to achieve two competing goals: Allow you to scale the amount of data you have to near infinite levels. Ensure that RavenDB remains simple to use and operate. The first goal is actually fairly easy and straightforward. It is the second part that made things complicated. After a lot of work, I believe that we have a really good solution at hand. In the webinar, I’m going to be presenting how RavenDB 6.0 implements sharding, the behavior of the system at scale, and all the details you need to know about how it works under the cover. I’m really excited to finally be able to show off the great work of the team! Join me, it’s going to be really interesting.

Detecting breaking changes between two versions of a NuGet package at packaging time

by Gérald Barré

posted on: January 09, 2023

I've already talked about preventing breaking changes in the post I fixed a bug. What should I do now?. But things evolve, and now the .NET SDK provides new features to help NuGet package authors to detect breaking changes between two versions of a NuGet package when building a new version.Starting

Answer

by Oren Eini

posted on: January 05, 2023

I posted this code previously: This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters using System; Iterator? it = new Iterator(); while (it.Value.MoveNext()) { Console.WriteLine(it.Value.Current); } public struct Iterator { public int Current; public bool MoveNext() { Current++; return Current < 10; } } view raw what.cs hosted with ❤ by GitHub And asked what it prints. This is actually an infinite loop that will print an endless amount of zeros to the console. The question is why. The answer is that we are running into two separate features of C# that interact with each other in a surprising way. The issue is that we are using a nullable iterator here, and accessing the struct using the Value property. The problem is that this is a struct, and using a property will cause it to be copied. So the way it works, the code actually runs: This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters Iterator? it = new Iterator(); while (true) { if (it.HasValue == false) break; Iterator localIt = it.Value; if (localIt.MoveNext() == false) break; Iterator localIt2 = it.Value; Console.WriteLine(localIt2.Current); } view raw how.cs hosted with ❤ by GitHub And now you can more easily see the temporary copies that are created and how because we are using a value type here, we are using a different instance each time.

Challenge

by Oren Eini

posted on: January 04, 2023

Given the following code: This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters using System; Iterator? it = new Iterator(); while (it.Value.MoveNext()) { Console.WriteLine(it.Value.Current); } public struct Iterator { public int Current; public bool MoveNext() { Current++; return Current < 10; } } view raw what.cs hosted with ❤ by GitHub Can you guess what it will do? Can you explain why?I love that this snippet is under 20 lines of code, but being able to explain it shows a lot more knowledge about C# than you would expect.

C# 11 List Patterns - Create compatible types

by Gérald Barré

posted on: January 03, 2023

C# 11 introduced list patterns. List patterns extend pattern matching to match sequences of elements in a list or an array. The goal of this post is not to explain the syntax but to show how to create a compatible type. If you don't know what list patterns are, I recommend reading the following doc

Adding dark theme to a website

by Gérald Barré

posted on: December 27, 2022

I've recently added a dark theme to this website. The light or dark theme is selected based on the browser / OS settings. In this post, I'll describe how I've added this support!Theme is selected based on browser settings#Step 1: Extracting colors to variablesThe first step is to extract all colors

Delete dotnet bin and obj folders recursively

by Ardalis

posted on: December 20, 2022

Although Visual Studio and the dotnet CLI both offer clean commands, neither one really cleans up bin and obj files generated by the build…Keep Reading →