4 ms·
Could you perhaps have one process for all paths that just contains a map with the counts and receives messages to increment? And then that map gets periodicall
by udfalkso 6y ago
Could you perhaps have one process for all paths that just contains a map with the counts and receives messages to increment? And then that map gets periodically persisted to the db as a bulk update? Is a separate process per path needed?
- dnautics 6y agostrictly speaking it's not needed, however, you probably don't want to do that because raw erlang processes are single threaded with no shared memory (but also no transactional locking, mutexes, or channels to worry about!) so at a certain scale you will become bottlenecked on that one process. ETS tables (an internal k-v lookup system) cheats a bit on the "no shared memory" rule, and Registry is backed by that and able to be a high-performance solution for sharding your path to the process that needs to handle.