- Red Hat JBoss Data Grid (JDG)
- Is there a better performance if @Field(Store.NO) is set
- Does the annotation @Field(Store.NO) save memory and storage
- When is it possible to set @Field(Store.NO) and what is the impact
The @Field annotation enable indexing for this field, it can be searched. The result being the key of the object that contains the matching field.
Store attribute will control whether the value can be retrieved directly from index, so there will not be any need to fetch the entity with the given key in order to obtain the field value.
Notice that projections will not work in infinispan if the flag Store.NO is set.
So the impact of setting
Store YES or NO is that with enabled store it might be faster to get the related field values faster.
But if that feature is not needed it will save resources and indexing is a bit faster.
In fact it depends on the application requirements which option should be choosen.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.