[erlang-questions] Most performant way to store/search a bag

AD straightflush@REDACTED
Wed May 2 15:30:21 CEST 2012


Hello,

 I have a problem where i need to map event_ids to connection objects (for
use in websockets to broadcast an event).  I am trying to determine the
most efficient way to map 1 event_id to possibly several thousand
connection objects.  Ultimately I would need to find every connection
object mapped to an ID and then send an event to each connection object.
 Is using an ETS bag and then using ets:foldl() to loop through the most
optimal ?  I was thinking of breaking down each event_type into a separate
ETS table and then storing the event_id for that event_type in the
respective ETS table with the connection object.

 Thoughts welcome.

Thanks
-AD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120502/7f1d2156/attachment.htm>


More information about the erlang-questions mailing list