I also consider the record to the list first, and then once every 10 seconds to write the database, and can reduce the overhead of procedures to do so?
Followed by the list whether to add the lock, or writing, will lose the data?
Finally want to ask, what is the best way to? thank you
CodePudding user response:
I feel into the Queue might be better, and then write a background thread, take the inside of the Queue data regularly, as to how much a take a inserted into the database and look at the situationCodePudding user response:
Records to the cache,A period of time, cache the inserted into the database,