centraldogma
centraldogma copied to clipboard
Compress replication commands when serializing
When a user creates a large amount of big commits in a replicated environment, a replica might suffer from heap shortage, because we serialize commits (PushAsIsCommand to be precise) into JSON and store it into ZooKeeper.
To reduce the risk of running out of memory, we could compress the serialized replication command (zstd?)
- Allow to disable compression so that gradual rollout is possible.
- Consider supporting multiple compression algorithms - 'Zstd' if JNI library is available. 'deflate' otherwise.
- Think about the ways to expose compression options such as level.
I'm interested in this issue.
Think about the ways to expose compression options such as level.
I think that we can provide an option like CompressionType that has ZSTD, and DEFLATE (and BROTLI?).