Java Reference
In-Depth Information
web servers for caching of static content, but caching of dynamic content
takes more time.
E XCEPTIONS : Some applications are not caching candidates. If there's no
way to know when cache data is invalid, a cached solution won't work. If
most data elements change too frequently, caches won't be effective. If a
database is large and the cached data set is too diffuse, the cache won't be
R EFACTORED SOLUTION NAME : Dynamic Command Cache.
S OLUTION ALSO KNOWN AS : Model 2, Modified Model-View-Controller.
R EFACTORED SOLUTION TYPE : Software or technology. Caches can be
bought or built.
R EFACTORED SOLUTION DESCRIPTION : Cache dynamic content where
possible. The Command design pattern and its relatives provide a conve-
nient interface point for a cache. Most major web application server ven-
dors have developed or are working on dynamic caching solutions, and
rolling your own is well worth the effort when the prepackaged solutions
do not fit.
T YPICAL CAUSES : Ignorance of the power of caching is the biggest culprit.
Designing a data model without caching solutions in mind is another.
A NECDOTAL EVIDENCE : “The individual pieces seem to be working, but
the application still seems slow.”
S YMPTOMS , CONSEQUENCES : Applications suffering from this antipattern
do a job many more times than is necessary. They can range anywhere
from slug-slow to slug-slime-slow, depending on the read / write ratio and
other factors.
S OLUTION A LTERNATIVES : Commercial versions of command caches
exist. Sometimes, data that would otherwise be cached can be stored in
the session state, at the application, session, or at page level.
Synchronized Read/Write Bottleneck
D ESCRIPTION : The Java programming language locks on the object level
for synchronization, but does not distinguish between readers and writers.
This locking mechanism is too restrictive for applications such as databases
and caches.
M OST FREQUENT SCALE : Microarchitecture.
Search WWH ::

Custom Search