IT Readings Log   

Tuesday, December 13, 2005

Database Cache and ADO.NET 2.0 Notifications

Brief description:

When working with big databases (as data volume not as number of objects) or when working with applications that need several database hits per second (volume in transactions), then you have to figure out how to optimize the process. After you carefully write the code looking up for useless data handling or database connections, after you review your queries for performance, etc... you can also apply the following development technique: you identify all the tables that are mostly read-only (definition tables for example - tables where you keep default system data) and you cache that data (save that data into a cache structure that can be accesses / used without running a query on the database, usually using middle tier cache techniques). This way you take some of the load off the database.

But there it is a problem: how do you know when those tables change? If you do not consider that the tables' data can change, then the above solution is ok, but if that table might change sometime (99% of the situations data in that table will change once and a while) then you probable have to update your cache on a frequency you kind of "guess".

ADO.NET 2.0 provides the possibility to be notified if that data is being changed, so you don't have to update the cache on a frequency, but only when the data changed. Cool.

Read the full article here

0 Comments:

Post a Comment

<< Home