Ømq and CakePHPSocket programming brought to your web app
What is Ømq?Intelligent socket library for messagingIncredibly ﬂexible, you can build your own patternsFast as hellFault tolerantLanguage agnostic
What is not Ømq?A message queue, it literally has zero message queuesA server you can connect toPersistentOut of the box solution (sorry to let you down)
Why use Ømq instead of X?It’s a paradigm change, you can hardly compare it to “othersolutions”When your system require more advanced networkinteractions (or patterns)You need cheap and easy parallel processingYou don’t want a single point of failureYou need exceptional speed
The solutionStart more servers on different portsBind your clients to multiple servers using the same socketØmq will automatically load balance them for youDrawback: You need to hardcode server addresses on eachclient
Load Balanced Requests More on balancing later...
Client Client Server Client ClientPublisher - Subscriber
Pub - SubLike a radio broadcast, if you tune in late you’ll miss part ofthe showIf client crashes the it will also lose messagesIt is possible to attach multiple ﬁlters to a connectionYou can listen on multiple addresses at once
Pub -SubØmq will buffer the messages in the subscriber if it is a “slowlistener”It will drop messages if buffer gets too bigThat is extremely cool
Devices or BrokersDevices are programs that will route messages between twonodesDevices are usually small but they can also be trusted withlarger tasks, such as persisting messagesUsed to solve hard problems but also introduce single pointsof failure
DevicesClients will connect to localhost:5559Servers will connect to localhost:5560Load balancing is done by ØmqIf dealer fails everything breaks :(You can install failover dealers! :)
DevicesAllow you to create more complex topologiesHelp you route requests to anonymous workersGood place for handling/persisting/retrying messages extralogicCan be written in any language supported by Ømq!