-
1. Re: Envers for Enterprise - pitfalls?
adamw Nov 20, 2012 4:09 PM (in response to didjit)1 of 1 people found this helpfulHello,
yes, it is open source and a part of Hibernate. I can tell you for sure it's used in several large "enterprise" systems, as some of them have been developed by my company.
As for pitfalls - two main technical problems are that you can't do joins in audit tables, and that when getting the list of revisions in which an entity changed, you don't get revisions where the "parent" (whatever it means) in the entity graph was modifies as well.
Envers doesn't handle versioning of data models - that's another thing. If you change the schema, you simply need to apply the exact same change to the audit model.
Hope this cleared a bit things for you,
Adam
-
2. Re: Envers for Enterprise - pitfalls?
didjit Nov 21, 2012 3:03 PM (in response to adamw)Thanks for the response, Adam!
When you say you can't join audit tables, do you just mean the query API doesn't support it or am I missing something more fundamental? And then, when you say you don't get revisions of parent entities, does it work the otherway around? That is, If I query for changes on the parent, will the the child entities be included in that search?
And finally, I'm assuming Envers is thread safe and farm friendly, yes?
Thanks again! Anyone else have some wisdom to share?
-- Chris
-
3. Re: Envers for Enterprise - pitfalls?
adamw Nov 28, 2012 8:08 AM (in response to didjit)1 of 1 people found this helpfulYes, the API doesn't support joins. And doing joins (at a given revision) would be problematic, but not impossible. The query would be complex and possibly slow.
If you query for changes in an entity, you only get changes in that entity. No changes for parent/child are included (it's non-trivial to define what a "parent" and "child" entity is, yet alone implement it )
Adam
-
4. Re: Envers for Enterprise - pitfalls?
didjit Nov 28, 2012 10:42 AM (in response to adamw)Thanks again, Adam.
I'm really intrigued by Envers. It seems like a wonderfully elegent, general solution. However, I think our needs are just different enough that I'll go with a homebrew solution.
In case my reasons are of any use, we need to track auditable events as well as data changes, and track the deltas to a data hierarchy of 2 - 3 levels. I had a couple designs that could do this with Envers, but in the end I'd still have to code something to track events, and I'm a little concerned about the significant increase in data volume by saving each object version completely rather than just the deltas. And then there's the query framework, which might have to be wrapped to be used by our existing framework...
But thanks again for the insight! This is definitely one to keep in my back pocket.
-- Chris