ADO.NET Caching

In the Java world, there are some products that do JDBC sentence caching (one is IronCache but there are others).

The basic idea is that you configure your Java app so the JDBC calls go through these products instead of going directly to the JDBC driver. Then you can choose which statements you want to cache and give them a 'time to live', and the fake JDBC driver caches them.

The cool thing about these products is that you don't have to modify your app in order to get the benefits, and that you will really see a performance improvement if you are not using any other database caching technology.

Would it be possible to write one of these products for ADO.NET? Technically it would be.  The problem is that in ADO.NET you can write code for a specific Data Provider, so you cannot add an interception layer between your code and the Data Provider.

Even if you are using something like Abstract ADO.NET, or if in the future Microsoft provides something like it built in the framework, the fact that you can code using the real Data Provider will prevent adding this functionality to any .NET code. You will have to change your code and use the abstract Data Provider to use it.

So, just in case you are not coding using the ADO.NET interfaces instead of the concrete classes (i.e. IDbConnection instead of SqlConnection), start doing it.

 

2 Comments

Comments have been disabled for this content.