3

I am using Javers with Spring Data JPA + Hibernate. When I use CurdRepository.save(Collection), the Javers API is auditing each object in the collection one by one and its causing delay to the overall insert process.

Before Integrating Javers the Process took 30 seconds to process 100 rows and after integrating Javers it took 80 seconds.

Is this an expected behavior ?

pradip
  • 31
  • 2

2 Answers2

0

Javers compares each object you are committing with its last snapshot persisted in JaversRepository. For large object graphs it could take a while.

Bartek Walacik
  • 3,386
  • 1
  • 9
  • 14
  • 1
    We are noticing that the performance issue per DB operation is very high, Without Javers it took 2 Milliseconds and with Javers 10093 milliseconds . Is there a way to skip the comparison operation to a seperate api while generating the difference or history ? – pradip May 18 '16 at 13:23
  • what do you mean by separate API? – Bartek Walacik May 19 '16 at 06:44
  • During Audit can we just store the Snapshot without doing the DIFF and then perform diff as a separate operation outside the current transaction? As I mentioned in the previous comment the time take is very high so trying to understand how we can reduce that. – pradip May 23 '16 at 15:28
  • No, there is no such option, snapshots are created and persisted only when JaVers detects some changes. Without that, you would have many unnecessary snapshots (for unchanged object). Maybe the reason is the size of your transaction, how many objects are you committing at once? – Bartek Walacik May 24 '16 at 07:32
  • we have 100 inserts in one transaction. Since each insert is taking more time, its increasing the overall duration of the transaction. – pradip Jun 06 '16 at 14:37
0

If your transaction (without JaVers) takes 30 seconds to insert 100 rows, I guess you have some performance problems with your infrastructure, possibly a database. On well-tuned database, inserts throughput is measured in milliseconds and not in hundreds of milliseconds.

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