Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1097

Allow for specifying whether storeAsBinary affects just keys, values or both

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Medium

      When using invalidation mode w/storeAsBinary enabled, both the cache key and value are serialized during a cache put. However, unlike the cache key, the cache value will never be sent over the wire - so it seems that this serialization cost is necessary. Since INVALIDATION_SYNC is the default mode for hibernate 2nd level caching of entities and collections, and since serializing an entity is potentially costly, this performance hit very noticeable, especially when compared to the performance of JBoss Cache, where serialization only happens when needed.

            [ISPN-1097] Allow for specifying whether storeAsBinary affects just keys, values or both

            Going with #2

            Manik Surtani (Inactive) added a comment - Going with #2

            From my perspective, #2 is easier to incorporate. #1 is a much more invasive solution, since it requires code changes.

            Paul Ferraro added a comment - From my perspective, #2 is easier to incorporate. #1 is a much more invasive solution, since it requires code changes.

            I like 2) more because you really want to make sure that the "flags" are used consistently.

            Sanne Grinovero (Inactive) added a comment - I like 2) more because you really want to make sure that the "flags" are used consistently.

            I can think of a few solutions, not all pretty. Let me know what you think would work best:

            1. Pass in a flag per option to control storage. E.g.,

              cache.withFlags(STORE_KEY_AS_BINARY, STORE_VALUE_AS_OBJECT).put(k, v);
            

            2. Make this a cache-wide configuration

              <storeAsBinary enabledOnKeys="true" enabledOnValues="false" />
            

            Manik Surtani (Inactive) added a comment - I can think of a few solutions, not all pretty. Let me know what you think would work best: 1. Pass in a flag per option to control storage. E.g., cache.withFlags(STORE_KEY_AS_BINARY, STORE_VALUE_AS_OBJECT).put(k, v); 2. Make this a cache-wide configuration <storeAsBinary enabledOnKeys= " true " enabledOnValues= " false " />

              manik_jira Manik Surtani (Inactive)
              pferraro@redhat.com Paul Ferraro
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: