Copy-on-write cloning #21
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Many database management systems implement "branching", which allows users to create a copy-on-write clones of a database. With a row manager (#20), we can make a copy of the in-memory index and bump the reference counts. This essentially gives us copy-on-write semantics with MVCC because updates create a new version rather than modify the rows in-place.
For example, let's say we have a database A and we make a clone B. Initially, they both point to the same set of rows. If either one of them updates a row, the other one will not be affected because the updating clone just marks the shared row version as deleted, but the actual row is unchanged.
As a future optimization, we could also use a copy-on-write hash table to even share the index between clones.
The text was updated successfully, but these errors were encountered: