Node isn't capable of doing something similar. You can somewhat simulate it with a timer, but since it is single-threaded you [cores] instance of Node, each with its own log separate queue and timer.
Wait, what? You have a set of queues and a set of timers, which are checked every threshold interval (like every second or so). You store your log entries in queues and write them with async batch writes when they pass a size/time threshold.
This is even a more efficient solution because I'm not forced to use multiple threads to do this. What is this solution missing for you?
If you use cluster to create processes they can all communicate with the parent process via message passing. The parent process now maintains 1 queue and 1 timer and is solely responsible for batch writes.
3
u/[deleted] Apr 27 '16
[removed] — view removed comment