python - Strategies for storing frequency of dynamic data -


sorry if title misleading.

i trying write program calculates frequency of emails being sent out of different email ids. need trigger alerts based on number , frequency of mails sent. example particular email if in past 60 minutes more 25 mails sent, trigger needs sent.

a different trigger directory based on rule. fundamental rules how many mails sent on past 60 minutes, 180 minutes, 12 hours , 24 hours. how come strategy calculate frequency , store without of system/cpu/database overheads.

the actual application legacy crm system. have no access mail server hack inside postfix or mta. there multiple domains involved, suggestion on mail server may not help.

we have ofcourse access every attempt send mail, , can @ recording them. challenge on large campaign database writes frequent, , doing real time number crunching resource intensive. avoid , come optimal solution

language python, because crm written using same.

try hack on client side in recording email attempt log file. can read file count frequency of emails sent.

i think can put data in memory in dict time ex 5 or 10 min. can send data db not putting load on db of frequent writes. if put check in code sudden surge in email particular domain might provide solution problem.


Comments