[erlang-questions] Parenting needed

Gerd Flaig <>
Fri Oct 13 10:41:48 CEST 2006


Sami Väisänen <> writes:

> In other words what I'm asking is some kind of general guidelines or
> ideas how to possibly structure the system and what to start looking
> at.  Basically just gentle poking in the right direction.

one thing I wonder about: As far as I understand, your C++ services
act on streams of messages and produce streams of messages. Why put
them all in the same address space instead of connecting them to your
Erlang nodes via open_port? That way, you get better fault isolation.

Regarding request routing, it's hard to give much meaningful advice
without knowing more about your goals. A simple implementation may use
pg2 to create a process group for each service, which is used by a
request router running on each node to pass the request and caller
information to the service. Pg2 chooses a local process in the group
if there is one, otherwise it chooses one randomly.

If you need load balancing, you could make your request router
broadcast (e.g. via rpc:abcast(nodes(), request_router, ...)) load
information, integrate received load information and use that for
request routing.

I found the OTP documentation most helpful, so I'd recommend digging
deeper into it. There's a wealth of information in there. Pay special
attention to the kernel and stdlib documentation.

       Goodbyte, Gerd.
-- 
The last thing one knows in constructing a work is what to put first.
                -- Blaise Pascal




More information about the erlang-questions mailing list