Skip to content

Copy on write or Write to a copy principle #603

@konard

Description

@konard

Database have two copies of the data.
Only one copy is writable, the over one are readable with multiple threads.

Once the transaction is written, the pointer to the readable copy is swapped to the new version of the database.
Then the transaction is replicated to the second copy.
After that, the system is ready to apply the next transaction from the transaction log.

Before the swap, we should wait to finish all readers in order to preserve consistency of data.
It is possible to write all transactions from transaction log that were not yet written while we wait for all readers to finish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions