dimanche 1 mai 2016

What pattern or technique should be used to generate a report from events?

Suppose there is a some system where rows in a database are filled when something happens:

  • when user simply logs in, a row is inserted to the database with type of login and time in table user_logins.
  • when operator make a call to the user, a row with operator id, user id and date insertted in database in table outgoing_calls
  • when operator does not answer to user call, a row with date, user id, and type call inserted into the database

Then after some time period is over, say month, we need a report on who called to who, how many calls were not answered, etc. What pattern should be used to organize this functionality?

At first glance this process seems like logging a lot, but logging is a process when we store a message with some format (date-processId-messageWithPlaceHolders). So using logging system for that is not very suitable.

From another point of view it looks like event processing, but it is not necessary to do any actions when "event" happens, no listeners, no queues. Just storing to database for further reporting.

So what pattern or technique should be used to implement this functionality effectively?

Aucun commentaire:

Enregistrer un commentaire