I'm trying to implement Javers for auditing my fairly complex object, and I love it so far. But when I see the database, entire snapshot is saved for my object which will eventually grow massive in my use case. Since I'm using Javers only to audit changes but not to restore object from snapshots, is there any way for me to store only changed properties on subsequent object commits?
Asked
Active
Viewed 420 times
1 Answers
0
There is no way to persist only a changed properties of an object. A snapshot is always a picture of a whole object. What I can advice, is to split your objects into smaller pieces (for example using ValueObject pattern). In this case, JaVers would save only snapshots of changed pieces (unchanged would be reused).
Other option is @DiffIgnore
(see ignoring things).
Btw, how large are your objects, I mean how many properties they contain?

Bartek Walacik
- 3,386
- 1
- 9
- 14