Advertisement
Advanced Redis, RedisJSON

What are the performance and memory considerations when storing very large or deeply nested JSON documents using RedisJSON?

Short answer

Very large JSON documents require more memory to store and can take longer to parse and serialize during read and write operations, and while RedisJSON's path based updates avoid needing to rewrite an entire document for small changes, extremely deep nesting or very large arrays…

Save Redis mock interview
Advertisement
AModel answer
Very large JSON documents require more memory to store and can take longer to parse and serialize during read and write operations, and while RedisJSON's path based updates avoid needing to rewrite an entire document for small changes, extremely deep nesting or very large arrays within a document can still add noticeable overhead, making it worth considering whether some data would be better split across multiple smaller, related documents instead.
-- Consider splitting a very large document
-- into smaller, related documents if it grows too large
JSON.SET order:1001:items $ '[{...}, {...}]'
Real-world example
A team notices performance degrading for a specific type of document that had grown to contain thousands of nested array items, and improves things by splitting that large array out into a separate, more manageably sized document.
Likely follow-ups
  • At what document size does performance typically start to noticeably degrade?
  • How do you decide when to split a large document versus keeping it together?
Related topics