Deprecated feature[Java programming language only]

Caching objects and their relationships (EntityManager API)

(Deprecated) 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 data grid by providing an easy way to declare and interact with a complex graph of related objects.

Deprecated featureNote: The EntityManager function is deprecated.

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, take the following limitations into consideration:

  • Indexes and queries must use reflection to query fields and properties in cache objects.
  • Custom data serialization is required to achieve performance for complex objects.
  • It is difficult to work with graphs of objects. You must develop the application to store artificial references between objects and manually join the objects.

Benefits of the EntityManager API

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 follows the Plain Old Java™ Object (POJO) style of programming that is adopted by most frameworks.