You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
over in #3719 I take advantage of the ability of some "niche" storage backends (memory and local files) to write subchunks inside a shard. This is a huge performance win under the right conditions. It requires a set_range(key, value, byte_range) method, which most stores will not support.
Our monolithic Store abc makes this situation -- methods some stores have, but others do not -- hard to express. We either use boolean attributes like supports_x, hasattr, or other hacks. Alternatively, we define a protocol like SupportsSetRange, and have store classes that support set_range inherit from SupportsSetRange. IMO this is the best approach.
So... why don't we replace the entire Store abc with protocols? This seems like a much better way to express the compositional nature of storage backends than a monolithic abstract base class.
Activity
kylebarron commentedon Mar 11, 2026
Big +1 towards using protocols. I think Zarrs does something similar in
zarrs_storagewith its various traits on the Rust side.I think you should be able to have protocols be intersected as needed.