# Release The Kraken! An Open-Source PubSub Server for the Real-Time Web

> Kraken is a distributed pub/sub server we wrote to handle the performance and scalability demands of real-time web apps like Asana.

Source: https://asana.com/inside-asana/release-the-kraken

## Release the Kraken! An open-source pub/sub server for the real-time web

🐙Today, we are releasing Kraken, the distributed pub/sub server we wrote to handle the performance and scalability demands of real-time web apps like Asana.

## What problem does Kraken solve?

One of the key promises of real-time web applications is that users will see changes made by other users as they happen, without hitting reload or refresh. Many of the [up-and-coming reactive web frameworks](http://www.quora.com/Web-Application-Frameworks/What-are-the-differences-between-Meteor-and-Luna/answer/Geoff-Schmidt) initially accomplish this by periodically re-executing queries against the database. When we were building the early prototypes of Asana, our reactive framework ([Luna](http://www.asana.com/luna)) was no different.

Unfortunately, most production-ready databases, from Mongo to Mysql, are unable to keep up with the query volume that even a moderate userbase creates when you frequently poll the database for changes. We recognized this problem early, and worked around it by designing an algorithm that incrementally updates queries in real time without putting any additional load on the database server. Key to this solution is the requirement that every query be notified about changes to objects that could potentially match, or stop matching the result set of each query.

That’s where Kraken comes into play. Kraken is responsible for routing data-invalidation messages between the processes that are running these queries so that they stay up-to-date.

## Why is Kraken the right solution?

Before building Kraken, we searched for an existing open-source pub/sub solution that would satisfy our needs. At the time, we discovered that most solutions in this space were designed to solve a much wider set of problems than we had, and yet none were particularly well-suited to solve the specific requirements of real-time apps like Asana. Our team had experience writing routing-based infrastructure and [ultimately decided to build a custom service](http://www.quora.com/Asana/Why-did-Asana-implement-their-own-pubsub-system/answer/Kris-Rasmussen) that did exactly what we needed – and nothing more.

The decision to build Kraken paid off. For the last three years, Kraken has been fearlessly routing messages between our servers to keep your team in sync. During this time, it has yet to crash even once. We’re excited to finally release Kraken to the community!

You can get Kraken yourself at Github

- [Why Asana is switching to TypeScript](/inside-asana/asana-switching-typescript)

Role spotlights

#### Tech Lead

Single-Page Applications are a powerful way to build rich applications in the browser but as the application grows, so does the code complexity. Asana has a code base with hundre ...

- [What is an Area Tech Lead at Asana?](/inside-asana/what-is-an-area-tech-lead-at-asana)

Role spotlights

Since joining #teamasana 4 months ago, it’s become clear to me that successful areas (groups of engineering teams with a shared goal) tended to have many things in common, includi ...

- [Security and Compliance: Better Together](/inside-asana/security-and-compliance-better-together)

Role spotlights

#### Head of Security

Many security practitioners have been frustrated by bad compliance audits, where an auditor wants something that is impossible, or nonsensical, or simply not worth implementing. O ...

- [What our interns built this summer: Meet our 2021 intern class](/inside-asana/what-our-interns-built-this-summer-meet-our-2021-intern-class)

Role spotlights

Every summer, we host a group of interns on our Design, Data, and Engineering teams, who work alongside full-time Asanas to do everything from contributing to highly visible featu ...

- [Release the Kraken! An open-source pub/sub server for the real-time web](/inside-asana/release-the-kraken)

Role spotlights

🐙Today, we are releasing Kraken, the distributed pub/sub server we wrote to handle the performance and scalability demands of real-time web apps like Asana.What problem does Krak ...

- [Role spotlights](/inside-asana/role-spotlights)
