4 Replies Latest reply on Nov 28, 2012 10:42 AM by Chris Crowley

    Envers for Enterprise - pitfalls?

    Chris Crowley Newbie

      Hello all,

      I just stumbled across Envers in the midst of developing my own auditing sytem.  Looks like you've already done it!  I'd love to hear from some of you any pitfalls or shortcomings that Envers presented while developing for an enterprise-level application.  More specifically, how well does it handle being spread across a server farm?  How's performance?  Query versatility?  Versioning/updating of data models?  Licensing? (I'm assuming it's open source, yes?)

       

      I've done some poking around the forums and documentation pages and it looks very promising, but being new to Spring & Hibernate I'm hesitant to base a high-priority feature on something we're not familiar with.  Any wisdom would be wonderful.  Thanks!

       

      -- Chris

        • 1. Re: Envers for Enterprise - pitfalls?
          Adam Warski Master

          Hello,

           

          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

          1 of 1 people found this helpful
          • 2. Re: Envers for Enterprise - pitfalls?
            Chris Crowley Newbie

            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?
              Adam Warski Master

              Yes, 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

              1 of 1 people found this helpful
              • 4. Re: Envers for Enterprise - pitfalls?
                Chris Crowley Newbie

                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