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

Implement versioned item functionallity #12

Open
dkraczkowski opened this issue Sep 25, 2022 · 0 comments
Open

Implement versioned item functionallity #12

dkraczkowski opened this issue Sep 25, 2022 · 0 comments
Labels
Milestone

Comments

@dkraczkowski
Copy link
Contributor

Description

amano.VersionedItem class should automatically recognised by save, put and update commands as a versioned (event sourced) entity. Each time a write is made with a versioned item, there should be two writes:

  • write to version 0
  • write to version n, where n is an integer number increased every time item is persisted.

Version of the item should be kept as a part of sort-key. The following is the schema for the versioned sort-key:

{n}:{sort_key}
  • n is the version number
  • sort_key is the user's sort key

Every time read operation is made to a versioned item with a condition, that condition should be automatically ammended and sort key should be either added or modified in the expression to filter only for the latest version 0.

This behaviour can be easily ignored in the userland if two representations are made for the same item, one is versioned the other is a normal item.

References

  • amano.VersionedItem

Test case scenarios

TBC

@dkraczkowski dkraczkowski added this to the 1.2.0 milestone Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant