I am working on a project where I have to constantly extract information from several servers (less than 1000) and write most of the information to the database. I narrowed my choices to 2:
Edit: this is a client, so I will periodically create connections and request information.
1 - Using the asynchronous approach, create N sockets for polling, decide whether the information will be written to the database on the callback, and put the useful information in the buffer. Then write information from the buffer using a timer.
2 - Using multithreading, create N threads with one socket per thread. A buffer of useful information will remain on the main thread, as well as loop recording.
Both options actually use several threads, only the second seems to create additional difficulty for creating each of the threads manually. Is there any merit? Is recording using a timer?
source
share