NNeon·DSAEngineerOnsite – Coding (Practical)
Copy-on-Write Branch / Snapshot (Practical)
Problem
Implement copy-on-write branching: branching a dataset shares pages until one branch writes, then copies the page (Neon's instant DB branching).
Example
branch() shares pages; write on branch copies only that page
Constraints
- O(1) branch; copy only on write
Approach
Reference-counted pages; copy-on-write on first mutation. Discuss space sharing.
added 6 days ago