Thursday, November 13, 2008

Enterprise caching with Java Caching System

JAVAWORLD'S ENTERPRISE JAVA ALERT
Solutions for Java developers
11/13/08

First, a quick primer on caching

By Steven Haines

A cache is designed to hold objects, typically in memory, for
immediate access by an application. An application interacts
differently with a cache from the way it interacts with external
storage solutions. Typically, an application obtains a
connection to a database, executes a query across a network, and
parses the results as they are returned. A cache maintains a
collection of readily available objects in a robust map-like
structure that does not require a network call. Enterprise Java
application performance improves exponentially when it accesses
reusable objects in a cache after loading them from a database,
rather than making remote database calls.

If your application has a manageable number of objects that are
frequently accessed, then a cache can probably improve its
performance. Java applications are constrained by available
resources in the JVM, the most precious of which is memory. It
makes no sense to take memory away from a JVM to hold objects
that are rarely accessed. It's probably better to load an object
that's accessed once every few hours as it's needed and leave
enough free memory for other resources. On the other hand, it's
better to load objects that are accessed several times a minute
-- or even several times an hour -- into a cache and serve them
from memory, rather than make a remote call every time the
object is needed. If the number of objects your application
accesses frequently is manageable within the available memory,
then it is a good candidate for caching. But if it
accessesmillionsof objects frequently, then it still might be in
an application's best interest to load objects as needed rather
than use 75 percent of a JVM's heap to host the cache.

Caching versus pooling

Confusion about the distinction between a cache and a pool often
emerges in discussions about caching. Which objects should be
cached and what objects should be pooled? The answer lies in the
nature of the objects themselves. If an object maintains state,
it should be cached. Stateless objects should be pooled. As an
analogy, consider two activities: buying food at a supermarket
and picking a child up from school. Any cashier can check out
any customer at the supermarket; it doesn't matter which cashier
you get, so cashiers should be pooled. When you pick up your
child from school, you wantyourchild, not someone else's, so
children should be cached.

Read more: What happens when you extrapolate this idea out to
enterprise Java objects?
http://www.networkworld.com/nljavaworldsente169889

More like this:

- J2EE object caching frameworks
http://www.networkworld.com/nljavaworldsente169890
- Distributed caching for Spring remoting services
http://www.networkworld.com/nljavaworldsente169891
- Server load balancing architectures
http://www.networkworld.com/nljavaworldsente165602

Also featured on JavaWorld

REST: An HTTP service

By Ted Neward in JW Blogs

Roy Fielding has weighed in on the recent "buzzwordiness" of
calling everything a "REST API", a tactic that has become moreen
vogueof late as vendors discover that the general programming
population is finding the WSDL-based XML services stack too
complex to navigate successfully for all but the simplest of
projects. Contrary to what many RESTafarians may be hoping, Roy
doesn't gather all these wayward children to his breast and
praise their anti-vendor/anti-corporate/anti-proprietary
efforts; instead, he blasts them pretty seriously for mangling
his term:

"I am getting frustrated by the number of people calling any
HTTP-based interface a REST API. Today's example is the
SocialSite REST API. That is RPC. It screams RPC. There is so
much coupling on display that it should be given an X rating
..."

Read more - REST: Is the manual broken?
http://www.javaworld.com/community/node/1783

Also see:

- REST for Java developers: It's about the information, stupid
http://www.networkworld.com/nljavaworldsente164872
- Ted Neward in JW Blogs
http://www.javaworld.com/community/blog/12

You've hit the tip of the iceberg: Read more in JW Blogs
http://www.javaworld.com/community/

_______________________________________________________________
This newsletter is sponsored by Motorola
Live Webcast: Wireless Security

Forrester's Khalid Kark presents wireless security best
practices in this live webcast. Successfully avoid experiencing
the cost of a wireless data security breach. Join us for this
live event on Thursday, December 11 at 2:00 p.m. EDT/11:00 a.m.
PDT. Better understand PCI DSS and how to stay compliant.
Register for this live webcast now.
http://adserver.fattail.com/redir/redirect.asp?CID=279542
_______________________________________________________________

Protecting the Enterprise with UTM.
Lower your security costs, better protect your enterprise and remove complexity from your IT environment with Unified Threat Management. Find out how in this "IT Buyers Guide to: Unified Threat Management." Discover what's included in a UTM appliance and learn the top market trends that IT professionals should know about. Download this guide now. http://www.nww.com/rpgx.jsp?c=XU1PTA7015Z3189
_______________________________________________________________

ALSO FEATURED ON JAVAWORLD

Spring Web Flow 2: A boon to JSF developers
http://www.networkworld.com/nljavaworldsente169325 Spring Web
Flow 2 seems tailored to the needs of JSF developers, and it
smoothes out Spring MVC on the front end. Dr. Xinyu Liu explains
how new support for Ajax, validation, persistence, and security
facilitates the development of rich Web applications using SWF
2.

Jump into JavaFX: JFX Preview SDK
http://www.networkworld.com/nljavaworldsente168635
Client-side developers are poised to take the plunge into
JavaFX, so why wait for the official release? Get a running jump
with this easy introduction to the JavaFX Preview SDK, with
NetBeans 6.1 and Project Nile.

EJB: From legacy technology to secret weapon
http://www.javaworld.com/javaworld/jw-10-2008/jw-10-ejb3.html
Java champion Adam Bien argues that EJB 3's streamlined
component model and persistence handling are worth a second
look. Learn the difference of convention over configuration,
annotations, dependency injection, and aspect orientation.

Server load balancing architectures:Transport- and
application-level solutions
http://www.networkworld.com/nljavaworldsente165602
A highly scalable and available server infrastructure depends on
its load balancing architecture. In this two-part article,
Gregor Roth introduces server load balancing basics and
discusses the pros and cons of transport-level server load
balancing versus application-level solutions.

REST for Java developers, Part 1: It's about the information,
stupid http://www.networkworld.com/nljavaworldsente164872
To understand REST, most Java developers need to stop focusing
on software and start focusing on information. Learn how REST's
information-driven, resource-oriented approach to building Web
services can satisfy your users and make your development
projects easier.

_______________________________________________________________
This newsletter is sponsored by Motorola
Live Webcast: Wireless Security

Forrester's Khalid Kark presents wireless security best
practices in this live webcast. Successfully avoid experiencing
the cost of a wireless data security breach. Join us for this
live event on Thursday, December 11 at 2:00 p.m. EDT/11:00 a.m.
PDT. Better understand PCI DSS and how to stay compliant.
Register for this live webcast now.
http://adserver.fattail.com/redir/redirect.asp?CID=279542
_______________________________________________________________

UPCOMING ON JAVAWORLD

-Measuring response time: Meet the client
-The Portlets packet: Get started with Portlets 2.0
-Checkstyle: Proactive, automated testing
-Introducing Hudson CI
-The Return of Java Tips!

Upcoming Podcasts:

-Todd Hoff on Java scalability

JavaWorld's Daily Brew - Starting conversations in the Java
developer community
http://www.javaworld.com/community
_______________________________________________________________

BONUS FEATURE

Application Performance Management Executive Guide.
Learn how to manage your applications for superior performance
in today's complex IT environments. With the influx of mobile
and Web 2.0 applications, ensuring applications consistently
perform well is becoming a daunting task. Discover new tools and
techniques to help you meet this challenge head on .Download
this Executive Guide now

https://www.accelacomm.com/jlp/PSA_80507080/7/80507080/
_______________________________________________________________

May we send you a free print subscription to Network World?
You've got the technology snapshot of your choice delivered at
your fingertips each day. Now, extend your knowledge by
receiving 50 FREE issues to our print publication. Apply today
at http://www.subscribenw.com/nl2

International subscribers click here:
http://nww1.com/go/circ_promo.html
_______________________________________________________________

SUBSCRIPTION SERVICES

To make newsletter subscription changes or cancellation, please
go to:
http://www.subscribenw.com/nl/login.jsp

To change your e-mail address, go to:
http://www.subscribenw.com/nl/eclogin.jsp

Subscription questions? Contact Customer Service by replying to
this message.

This message was sent to: 4bloggermail@gmail.com
Please use this address when modifying your subscription.
_______________________________________________________________

For advertising information, write Susan Cardoza, Associate
Publisher Online, at: mailto:sponsorships@nwfusion.com
_______________________________________________________________

JavaWorld is a trademark or registered trademark of Sun
Microsystems, Inc. in the United States and other countries, and
is used under license by International Data Group, Inc. All
other product names and trademarks used are the trademarks of
their respective owners.

Copyright 2008 JavaWorld.
http://www.javaworld.com

Blog Archive