Search code examples
phpmysqlxmlnode.jsphpwebsocket

How we would create XML without any load on MYSQL?


I have a MYSQL database with an activity table whose rows are text statements(activities). My challenge is to Push the latest activity into the ticker(An area where all my latest activity display) as soon as it gets inserted into the table . I can achieve this pinging the table every N seconds , but this consume a lots of memory resourses and Server. So XML is the best way , but problem with how to create a XML file without Any load of MYSQL? Please suggest me how to achieve this . Thanks in advance !!!


Solution

  • Websockets are designed to respond to PUSH requests (server to client) problematics, avoiding these costly "refresh every x seconds" operations.

    Apparently HTML5 provides new tools to handle websockets, maybe you wish to have a look at them?

    refer to: http://www.html5rocks.com/en/tutorials/websockets/basics/