EntityManager API introduction

Most cache products use map-based APIs to store data as key-value pairs. The ObjectMap API and the dynamic cache in WebSphere Application Server, among others, use this approach. However, map-based APIs have limitations. The EntityManager API simplifies the interaction with the eXtreme Scale cache by providing an easy way to declare and interact with a complex graph of related objects.

Map-based API limitations

If you are using a map-based API, such as the dynamic cache in WebSphere® Application Server or the ObjectMap API, you have to take the following limitations into consideration:

  • The cache must use reflection to extract data from the objects in the cache, which has performance implications.
  • Two applications cannot share a cache if they use different objects for the same data.
  • You cannot use data evolution because you cannot easily add an attribute to a cached Java™ object.
  • It is difficult to work with graphs of objects. The application has to store artificial references between objects and manually join them together.

Using EntityManager

The EntityManager API uses the existing Map-based infrastructure, but it converts entity objects to and from tuples before storing or reading them from the Map. An entity object is transformed into a key tuple and a value tuple, which are then stored as key-value pairs. A tuple is an array of primitive attributes.

This set of APIs significantly eases the use of eXtreme Scale by following the Plain Old Java Object (POJO) style of programming that is adopted by most frameworks.

New! Subscribe to Information Center updates

rss feed You can now subscribe to updates for the WebSphere eXtreme Scale Information Center. This feed includes a description of the changes that occur in the monthly refreshes. Use the RSS feed to subscribe to changes using your favorite feed reader.