Databases Reference
In-Depth Information
Caching
To minimize roundtrips to the source databases, the shard library provides an optional caching mechanism. The
caching technique used in this library offers basic capabilities and can be extended to address more complex
scenarios. The objective of this library is to cache the entire DataTable of each database backend whenever requested.
Figure 9-6 shows the logical decision tree of the caching approach. It's important to note that this library calculates a
cache key based on each parameter, the parameter value, each SQL statement, and the database's GUID.
Figure 9-6. Caching logic
The effect of the cache is visible when you connect to SQL Database. Considering that connecting to a SQL
Database instance takes up to 250 milliseconds the first time, memory access is significantly faster. The importance of
the cache increases as the number of records increases and the number of databases increases in the shard.
 
Search WWH ::




Custom Search