entity caching in hazelcast

25 views
Skip to first unread message

Hakan Küçük

unread,
Jul 3, 2023, 10:13:53 AM7/3/23
to Hazelcast

We currently utilize Hazelcast in a non-clustered environment alongside Spring Cache Abstraction. However, we now intend to transition into a clustered environment and require our cache to be replicated across multiple machines. The challenge we're facing is that our cached entities involve one-to-many relationships, resulting in slow performance.

For instance, consider the following example:

class Student { 
    int id; 
   String name;

   @OneToMany(lazy) List<Lecture> lectures; 


 @Cacheable(name=Cache)
 List<Student> search(String namePrefix) { 
 }

During the serialization process, all lazy fields are being serialized. Since our entities have deep relationships and sometimes even circular references, this leads to a significant amount of data being transmitted over the network in the clustering setup.

Is there a configuration setting in Hazelcast that allows us to bypass the serialization of lazy fields?


oz...@hazelcast.com

unread,
Aug 8, 2023, 4:16:06 AM8/8/23
to Hazelcast
Reply all
Reply to author
Forward
0 new messages