user2106417
user2106417

Reputation: 41

Infinispan persistence without any database?

Being a newbie to Infinispan, I'm exploring the option of of having Infinispan 5.1.5 for both distributed caching as well as datastore.

So, the idea is not to have a separate datastore viz. database, rather make use of only "Infinispan Cache Stores" for persisting the application data into disk files.

The application data shall include, but not limited to historical data of events, flows etc.

Can I live with only Infinispan for data persistence and without Database? Is there any limitations w.r. to quantum of data, retrieval, sorting etc on Infinispan?

Any inputs would be of great help?

Upvotes: 4

Views: 1722

Answers (1)

Sanne
Sanne

Reputation: 6107

You can do it, but be prepared to manage changes in serialization format. If your own class definitions change (assuming you store Java objects), you either have to define custom *Externalizer*s which know how to deal with class changes, or you'll have to dump data and restore it after an upgrade. Also in case you need to upgrade Infinispan itself, you might need to dump data out and restore or see rolling upgrades, which at the moment requires Hot Rod clients and to use at least version 5.2.

It's able to do sorting via Infinispan Query, but remember you don't have Join or similar operations: works great for some sets of problems, doesn't work for all. Also Infinispan Query makes the query aspect quite powerfull but at a performance penalty on write operations to update the indexes: it works faster if you can re-think your model to work with just put/get operations.

You could have a look at Hibernate OGM to map structured entities in Infinispan, including relations, using only put/get operations. This is supposed to be the most practical interface as it uses well-known JPA mapping, and makes it possible to use queries via Hibernate Search (Although with very similar limitations as those of Infinispan Query, as they use the same indexing technology based on Lucene).

Upvotes: 4

Related Questions