Another possibility that opens up when designing a program like ProtoWrap is to implement in it a load balancer. Load balancing is a technique very often used in heavy-traffic sites, allowing many computers to answer at the requests directed at a single IP address/port pair. There are many ways to achieve this:
[user@host user]$ nslookup www.microsoft.com
Server: dns1.unam.mx
Address: 132.248.204.1
Non-authoritative answer:
Name: www.microsoft.akadns.net
Addresses: 207.46.230.229, 207.46.230.219, 207.46.131.199
207.46.230.218, 207.46.130.45
Aliases: www.microsoft.com
, suited for different purposes. Among the most often heard is Beowulf,
a project started at NASA which implements Parallel Virtual Machines.
However, clustering servers do not require (in fact, would hardly be benefited
from) a programming technique as hard to master and code; a fork-and-forget
clustering system such as Mosix
is much more adequate -- In such a system, a master server appears to be the
only one running, but when a connection is recieved, the server process is forked
to a different computer, according to the systems' current load. This may be
the most scalable solution, and it provides the closest answer to high-availability
requirements.How would this implementation look like? ProtoWrap's code could be easily modified to discern whether the value contained in the destAddr attribute is a scalar value (as it usually is) or a reference to an array of values. When creating the wrapper, instead of
destAddr => '192.168.0.1'
we would have
destAddr => ['192.168.0.1', '192.168.0.2', '192.168.0.3']