jonnify·persistence /echo-persistence/rust/opendal-and-the-portable-remote

Module 8 · Dive 8.2

OpenDAL & the portable remote.

The Rust engine never talks to Tigris directly. It writes through an Apache OpenDAL operator — one API over many storage backends — so the remote can be Tigris, S3, local disk, or memory by configuration, not by changing code. And the fence is a single call: write(…, if_not_exists), whose create-if-not-exists semantics hold identically on every backend. Pick a backend and write the same segment twice.

§1

Same call, any backend

interactive
One operator, swappable drivers. The engine issues one conditional write; OpenDAL routes it to the selected backend. The call and its result type never change — only the driver does. Write the same key twice to see the fence hold.
echo_graft storage-agnostic op.write("seg/42",  bytes, if_not_exists) OpenDAL Operator · one API idle write(…) route
readout · The active backend is Tigris. Press write: OpenDAL routes the same if_not_exists call to it — created. Press again — ConditionNotMatch. Switch backend and repeat: identical behaviour, different driver.
§2

The remote is a detail, the fence is not

graft.engine-split.design.md

Putting OpenDAL between the engine and the object store buys two things. First, portability: the same build runs against Tigris in production, MinIO or the local filesystem in a test, or an in-memory store in a unit test, because the operator presents one interface and the driver is chosen by config — in production that driver is RemoteConfig::S3Compatible, which reads AWS_ENDPOINT_URL to point at Tigris. Second — and this is the part that matters for correctness — the conditional write is expressed once. The engine asks OpenDAL to write the segment only if the key does not already exist; on a backend that supports it natively that becomes the store’s create-if-not-exists, and the failure surfaces uniformly as ConditionNotMatch. That single call is the fence (Module 3), and because it lives at the operator boundary it is the same fence no matter which store is underneath. So the Rust engine gets the exact remote-commit guarantee the native engine gets from Tigris directly — the subject of the next module, where both engines meet at one shared remote.

§3

References & sources