Replies: 1 comment
-
Hi @esskar
A
FusionCache is not based on JSON, instead it can support any serializer out there (or you can create your own if you like) thanks to a generic For the most common ones I already created adapter packages, which you can find here: as you can see there are the usual suspects that are JSON-based, but there are also others which are natively optimized for binary representations like MessagePack, MemoryPack or Protobuf. Usually JSON is the preferred approach for most data types, since it's good enough perf-wise and handles pretty well things like an evolvable schema, which can happen when you refactor your In your case, if you need to handle I just did a test locally, and with a 100K bytes blob, the serialized entry in Redis with Protobuf (just as an example) was only 24 bytes larger. I'd suggest to try with Protobuf or one of the other 2 and see if the size/perf is good enough for you, but I think this is the way. Oh, and since FusionCache supports multiple named caches, you'll not be forced to use Protobuf (or whatever) for everything: you can create 2 named caches, one for your common objects configured with a JSON-based serializer, and one for your binary data configured with Protobuf. Finally, since you are starting right now, I also suggest to start directly with FusionCache V2 (I recently released the preview-4) so that when it will be officially out in a week or two you'll be already on the latest version. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I want to make the transformation to fusion cache; before I can decide, i want to know how it handles byte arrays?
We are currently only using redis as a cache, and we are caching the data like
Redis will store the data as is, fusion cache will probably use the JSON serializer which i want to avoid. Is there a way to do so?
Beta Was this translation helpful? Give feedback.
All reactions