Use the right tool for the data rule
Start with the tree's lifetime. Then choose how much coordination each operation needs, how a scan should see concurrent writes, and who runs maintenance.
Use the ordinary API when a new value does not depend on the current value.
Use atomic methods when the current value determines the accepted update.
Use a transaction when several keys in one tree must share a commit boundary.
Opening a tree
Choose OpenOrCreate, Open, or Create. Configure the factory and keep the tree and maintainer alive for your application.
Open and own storageReads and writes
Read live values, replace records, and choose add or delete behavior. Understand which conditional checks need stronger coordination.
Choose a write APIAtomic operations
Implement counters and conditional replacements, interpret cancellation, and keep competing writers on the same atomic path.
Coordinate one keyTransactions
Commit related keys in one tree. Handle conflicts, pending dependencies, retries, and unfinished transactions.
Commit a unit of workIteration and ranges
Seek to a lower bound, scan forward or backward, and choose how the iterator sees concurrent writes.
Read an ordered rangeMaintenance
Schedule merges, manage inactive caches, wait for background work, and monitor segment lifecycle events.
Run the storage lifecycle