[infinispan-dev] Infinispan and JPA entities

Randall Hauch rhauch at redhat.com
Thu Feb 14 15:44:29 EST 2013


I've been wondering about this particular use case for a while:

A client application simply uses get, put, and query for objects stored in Infinispan, where the objects really are mapped to a real schema in a relational database. If the objects were JPA-like entities, the database mapping could be defined via a subset of the JPA annotations. Essentially, Infinispan becomes a key-value store on top of a traditional database with a domain-specific schema. Add some JAXB annotations, and it quickly becomes possible to expose these entities via a simple RESTful service. A new cache store implementation could persist the entities to JDBC using the annotations.

This may seem a bit odd at first. Why not just use JPA directly? IMO, for a certain class of applications, this scenario is architecturally easier to understand. Plus, if you put this on top of Teiid's ability to create a virtual database (with a virtual schema that matches what you want the objects to be), then you could put these new entities on top of an existing database with a schema that doesn't necessarily mirror the entity structure. 

Is this crazy? Is there a better way of achieving this?

Randall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20130214/e763acac/attachment.html 


More information about the infinispan-dev mailing list