Monday 12 August 2019

nuget package wisdom - Cosmos DB Table API

I have been working in .NET ecosystem for a long time and managing correct assembly references in a large/distributed code base (i.e. managed via multiple git repos) is indeed a hard task. More so, when VS lets you pick few "system" references in "Reference Assemblies" and remaining from "packages" location downloaded via nuget feeds.

However, developers find a way to manage it in one way or another.

Once you achieve that, you are faced with two other hard tasks.

1. Maintaining the same nuget package version across solutions.
2. Ensuring that referenced nuget packages are the latest stable versions.

I will focus more on # 2 as i recently found out that if many times you miss out on goodness of new APIs/better performance if you do not upgrade.

Case in point:

I have a solution that utilizes Azure Cosmos Table API as storage technology. The code to read/write to the store was written more than a year ago and was using a nuget named "Microsoft.Azure.CosmosDB.Table".

Solution was using it with version 1.*.*. The average response time for the API for writing to cosmos Table was ~180ms which is quite decent actually.

However, when i upgraded the solution to use version 2.1.1 (latest), the average response time dropped to ~70ms which is even better.

The gain isn't too much when look at it from the perspective of absolute numbers. However, they do add up to a lot if your system is making hundreds of such calls.

Learning : keep updating the newest version on regular intervals :)