问题
Are there any production best practices (tuning and similar) to follow to avoid:
- Performance issues
- Uncontrolled data growth
Are also there any cleanup utilities or best practices in order to remove "old" or unnecessary data? Could the usage of MongoDB solve eventual of performance or data maintenance problems?
回答1:
There is one performance hint -- keep Javers data small. You should control the number of Snapshots
persisted to JaversRepository.
Applications should track changes only in important data that are entered by users. You can call it core-domain data or business-relevant data. All technical data, data imported from other systems and generated data should be ignored. There are various ways of ignoring things in Javers.
At the end of the day, when you show a change log to your users, it should look like a concise, human-readable story, for example:
System.out.println(changes.prettyPrint());
Changes:
Commit 2.0 done by author at 15 Apr 2018, 22:50:15 :
* changes on Employee/Frodo :
- 'salary' changed from '10000' to '11000'
- 'subordinates' collection changes :
0. 'Employee/Sam' added
* new object: Employee/Sam
* changes on Employee/Sam :
- 'boss' changed from '' to 'Employee/Frodo'
- 'name' changed from '' to 'Sam'
- 'salary' changed from '0' to '2000'
Commit 1.0 done by author at 15 Apr 2018, 22:50:15 :
* new object: Employee/Frodo
* changes on Employee/Frodo :
- 'name' changed from '' to 'Frodo'
- 'salary' changed from '0' to '10000'
来源:https://stackoverflow.com/questions/57972894/javers-production-best-practices