Storing user feeds as JSON strings in Redis – how can I optimize this for performance and memory usage?
Loading
Storing user feeds as JSON strings in Redis – how can I optimize this for performance and memory usage?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tasadduq BurneyPosted Dec 8, 2025, 5:45 PM
Hey,
Hope you're keeping well.
For feed-based systems in .NET, storing large JSON blobs in Redis as plain strings is rarely optimal. If you need partial updates or selective retrieval, use RedisJSON with
NRedisStackso you can update paths atomically without reserializing the entire object. For memory efficiency, serialize withSystem.Text.JsonusingJsonSerializerOptionsto trim unnecessary properties, and consider compressing withZstdviaZstdSharpbefore storing. If feeds are immutable once written, splitting them into smaller keyed chunks (e.g., per user or time window) can reduce eviction impact and improve lookup speed underallkeys-lruorvolatile-ttl. Always benchmark serialization, compression, and Redis command latency in your ASP.NET Core application before committing to a storage strategy.Thanks and regards,
Taz