This discussion is archived
3 Replies Latest reply: Jan 30, 2013 11:44 AM by jschellSomeoneStoleMyAlias RSS

Input on the design

987189 Newbie
Currently Being Moderated
We are working on a Virtual Directory integration and there are lot of read/write event happens on the directory. when the user's certain attributes changed, we need to log the event (Audit) in our own DB. The vendor provides api to capture the events like this in postXXX (postInsert, postUpdate etc) methods. So far so good.

Now question is, I want to make the inserting audit data in asynchronous fashion. The code which we are going to write in postXXX shouldn't impact the regular event flow. What are the best possible approaches? Introducing JMS might work but we need to deal with managing queues, monitor and ton of other stuff. How about using ExecutorService? is it viable solution if there are 100's of events happening in every minute?

Any thoughts?
  • 1. Re: Input on the design
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    984186 wrote:
    is it viable solution if there are 100's of events happening in every minute?
    Have you sized the system? Is it realistic to suppose that you would have that volume? Is that burst or sustained?

    A 100 events a minute is not a substantial rate for any modern database. And if the execution stream for each is distinct there probably isn't any reason to make it async because it wouldn't have a significant impact on flow. However you might want to wrap it in a try/catch to insure that a database problem doesn't stop it.

    If you actually need guaranteed delivery then you should probably consider a JMS solution.
  • 2. Re: Input on the design
    987189 Newbie
    Currently Being Moderated
    Thank you. 99% percent of times we get 100 per minute is the load. However, when the bulk load happens or hr event changes then we get few thousands per min or so. and we must need to have the message delivery confirmation as it pertains to Audit.

    Regarding JMS solution, are there any glitches I have to consider? I am thinking the following approach. Write ExecutorService - initiate a separate thread to write into jms queue and MDB to consume that data and put it in DB.


    Thanks
  • 3. Re: Input on the design
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    984186 wrote:
    Thank you. 99% percent of times we get 100 per minute is the load.
    So 2 per second.
    However, when the bulk load happens or hr event changes then we get few thousands per min or so.
    So 20 per second
    and we must need to have the message delivery confirmation as it pertains to Audit.
    So why not just write it to the database as part of the flow?

    If you are concerned about that then you should be concerned about the 20 per second as well, and you should batch it (both of them.)

    >
    Regarding JMS solution, are there any glitches I have to consider?
    You have to get the configuration right.
    You have to monitor the JMS service itself.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points