mardi 22 novembre 2022

Offset management Java patten

Let's suppose I have some abstract entity in the system which created each time.

Each of those entities should have two ID - Serial and Sequence.

UC

  1. Initial state - A(Serial=1, Sequence=1).
  2. Scale out - A(Serial=1, Sequence=1), A(Serial=2, Sequence=2)
  3. Scale in - A(Serial=1, Sequence=1)
  4. Scale out again - A(Serial=1, Sequence=1), A(Serial=4, Sequence=3)

Meaning that sequence id it is kind of offset that stored and previous versions is not used.

My question is - is there any patterns in Java that you would recommend to look, main aim of which is store those values in some generic data structure.

Aucun commentaire:

Enregistrer un commentaire