Java Reference
In-Depth Information
Application provider's site
Layer + comm
cost for
1 req
1
unit
1
unit
5
units
10
units
10
units
50%
100%
30%
10%
3%
% requests flowing through to each layer
Average cost
Layer: 100%*1=1
50%*1=.5
30%*5=1.5
10%*10=1
3%*10=.3
Total: 1+.5+1.5+1+.3=4.3
Figure 5.2 Aggressive caching can result in improved performance on an e-business
architecture, and will also significantly decrease the workload of nodes that are protected by
earlier caches. This architecture implements caches at many different points, and the Internet
has some built-in caches that we never see.
It will have a memory leak in the cache (which may be acceptable if the
database size is small).
It will not clean connections in a finally block.
It will not pool connections.
In the spirit of our continuous refactoring, these issues will all be addressed in
successive refactoring steps. This example shows only one possible problem
where a cache would make an extreme difference in performance. In our
bulletin board, the content is dynamic, because the posts will change as peo-
ple respond and the lists will change as new posts are added. This characteris-
tic makes caching much more problematic than the caching of static content.
The base web server's cache cannot handle dynamic data. Regardless, we
expect to serve the same post many times between updates, which will place a
significant drain on performance. E-commerce catalogs, content-publishing
Search WWH ::




Custom Search