The .NET Framework has become very popular after it’s first open-source release back in 2016. Being cross-platform, it allows building different variety of applications for different platforms such as web apps, backend APIs, console applications, desktop applications and even cross-platform mobile applications using Xamarin.
Usually, the most common thing between all these types of applications that we can build using the awesome .NET framework, is that they will all probably have to manage some kind of data at one point in time. And most of the times this data will be coming from some external data stores such as databases or other external applications. This implies that our .NET application will depend on that external system.
Communicating with external systems means there will be network calls and network calls are expensive in terms of memory and latency. Every communication that exits the process boundary of our app adds a little bit of latency. Also, if the external database system becomes overloaded due to many users using our application, it might become slow to respond and thus further hinder the performance of our application.
To overcome these potential challenges we should consider employing a caching strategy. There are 2 most common caching strategies that we could use: in-memory cache and distributed cache.