Reputation:
I need to develop a realtime notification system. Load won't be high, about a dozen of events per hour. But I just want to make it scalable for future development.
My application is written entirely in PHP
.
I have found different ways of implementing real-time applications. And I think the following architecture is quite simple and have a lot of benefits.
But I want to use the Faye
library for implementing real time notifications, because it has fallbacks, and generally I am not going to use Websockets
because my load is really low, and at first I will stick to the long-polling
mechanism. Faye
provides a convenient way for disabling and enabling different transport protocols.
Here is how my architecture is going to look
However I have one question regarding communicating back from a client.
Consider the following case.
HTTP
request to a PHP
appAJAX
request Redis
database and consumed by Faye
So far so good, but I need to some sort of back communication, for example when a client dismisses an event.
How should this be implemented, should I send this action back using Faye
or this should be sent directly to the PHP
application. In case of sending an event back using Faye
I need to notify my PHP
application that an event was seen and dismissed. Of course I can use the same database from a Ruby application as used by PHP app, but this makes these two application coupled.
Could you suggest a right way to implement this ?
Upvotes: 0
Views: 224