Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

总结一下对象存储元数据与文件之间的关系 #17

Closed
liqul opened this issue Apr 22, 2018 · 3 comments
Closed

总结一下对象存储元数据与文件之间的关系 #17

liqul opened this issue Apr 22, 2018 · 3 comments
Projects

Comments

@liqul
Copy link
Owner

liqul commented Apr 22, 2018

Data model
metadata -> object
metadata: key + others + create_time + pointer

Lock based

insert:

  1. lock the key, even if the key is not presented
  2. read by the key
    2.1 if does not exist, insert
    2.2 if exists, update the metadata (including create_time), backup the old pointer
  3. es as a special case, no lock but version control

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

@liqul liqul created this issue from a note in bloging (In progress) Apr 22, 2018
@liqul
Copy link
Owner Author

liqul commented Apr 22, 2018

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

@liqul
Copy link
Owner Author

liqul commented Apr 22, 2018

mysql can be viewed as an optimization of mvcc

@liqul
Copy link
Owner Author

liqul commented May 1, 2018

完整讨论对象服务的思路

@liqul liqul closed this as completed Jan 16, 2019
bloging automation moved this from In progress to Done Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
bloging
  
Done
Development

No branches or pull requests

1 participant