quinta-feira, 6 de setembro de 2012

sexta-feira, 22 de junho de 2012

Speeding ROBLOX.com with Message Queuing


In an April blog post, Supporting Millions of Players at ROBLOX, we mapped out ROBLOX’s back-end web technology. Today, Gigi Sayfan discusses message queuing, a single component nestled in our greater web infrastructure, and how it helps us accelerate updates to our huge catalog and the user-account search function. He also offers practical advice on setting up a message queuing application for a specific set of goals.

In a common, distributed web application architecture, multiple web servers talk directly to a database and/or to back-end services that relay messages to the database. ROBLOX has millions of users, who constantly bombard our many web servers with requests that eventually funnel into the database. If the database is busy, it will be slow to respond to requests – both from the web servers and back-end services – and the user experience will suffer. Worst case scenario, requests time out.

To avoid slow responses and time-outs, ROBLOX has implemented a message queue, which currently manages roughly 15 million requests a day.



A message queue is a generic component with the sole purpose of receiving messages from producers, storing the messages, and delivering messages to consumers that process them. Consider this situation: we make an update to the ROBLOX catalog. The web server (producer) sends an update to the message queue, which stores the message. At some point, a special service (consumer) will process the message from the queue and update the catalog’s search index on Solr (our search platform). This means the web server doesn’t have to wait for the update to complete; it drops off the message and moves on to the next request.


Another benefit of a message queue is that there is very loose coupling between producers and consumers, so one side can completely change without affecting the other




Messaging with RabbitMQ


We at ROBLOX picked RabbitMQ as our messaging solution. RabbitMQ provides a lightning-fast server that can be clustered, client libraries in many languages, an administration API and a slick web dashboard. It’s also free (using open protocol AMQP), fast, cross-platform, stable (based on Erlang’s Open Telecom Platform), field-tested and supported by a large, active community.

There are many other messaging products out there, but none provide all these benefits with the same degree of robustness and support.