You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mysql:
unique key = key + version (1, 2, 3, ...)
read the last version, if does not exist, insert with version = 1; if exists, start transaction to insert the new version (last version + 1), remove the last version, and backup the old pointer to a special table.
isolation level = read committed
Data model
metadata -> object
metadata: key + others + create_time + pointer
Lock based
insert:
2.1 if does not exist, insert
2.2 if exists, update the metadata (including create_time), backup the old pointer
delete:
= insert a tombstone with an empty pointer
update:
only update non-key fields
search:
since each key has only one entry, just find it
MVCC
insert:
insert with current timestamp as version. if two insertions with the same version, one fails
delete:
= insert a tombstone with an empty pointer
update:
= insert a new version with a new timestamp. and other unmodified fields the same with the latest version
search:
for each key, get the version with the latest timestamp
The text was updated successfully, but these errors were encountered: