Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to effectively log 100s to 1000s of actions to a database

I currently have a scenario where a 1000 actions could occur in a matter of seconds and I need to store all these actions in a database.

What I currently do is keep a idle timer, once this timer reaches a pre-defined time, I take the cached actions (actions since last commit - which is just a simple list) and commit those actions to the database.

The UI needs to be responsive as possible (duh?).

Other than pushing the database logging to a seperate thread, are there any other suggestions with regards to performance that anyone can help me out with?

like image 829
Pieter Germishuys Avatar asked Jan 08 '11 07:01

Pieter Germishuys


1 Answers

Try using 3rd party logging frameworks like NLog which have asynchronous logging wrapper.

like image 160
Aaron Avatar answered Oct 26 '22 23:10

Aaron