The Cube x COTA user story.
COTA was founded in 2011, and they combine oncology expertise with advanced technology and analytics to organize real-world medical treatment data to guide cancer research and care.
COTA builds solutions to better support oncologists' clinical decision-making and researchers' development of new drugs and therapies. One such product is the Real World Analytics (RWA) solution that helps clinicians and researchers make sense of fragmented and often incomplete electronic health records (EHR) data and provide insight into the patient population, treatment patterns, disease outcomes, etc.
COTA has access to millions of electronic oncology patient records with a vast amount of associated data unmatched in the oncology healthcare industry. During COTA's recent Series D funding announcement, they shared the expansion of their data access by more than 300%.
Data analytics is thus critical for COTA, and they strive to apply innovative ways to improve the technology used in the healthcare space. The COTA team wanted to replace off-the-shelf solutions like Qlik and Tableau, which require heavy customization and specialty configuration knowledge with a more developer-friendly ecosystem.
With Cube.js, they found that match and leveraged its reference architecture to save development cycles that previously involved writing custom queries, custom data munging, and processing. When the COTA team discovered Cube.js in 2019, they became early adopters of Cube.js soon after it was open sourced. You will find Cube.js in action today in this RWA demo video.
Today, Cube.js is a foundational tool for COTA's products, with Cube.js Data Schema serving as the single source of truth for their data and Cube.js API powering their applications.
The COTA team uses Google Cloud Platform to host and run their applications, including the Cube.js deployment. Their deep, longitudinal datasets feature upwards of 150 tables from structured and unstructured sources, which come together in their data products to form a cohesive, comprehensive patient journey.
While assessing possible architecture options for the Cube.js deployment, the COTA team initially explored using Google Cloud Functions to run Cube.js in serverless mode, and they were among the first Cube.js users who were interested in support for Google Cloud Functions. However, they ultimately decided to use microservices hosted on Google Compute Engine.
Since multiple queries are often run against Cube.js API by users while navigating the applications, the COTA team wanted to ensure that queries can be canceled to conserve resources. For example, when a user queries multiple times, they want to cancel the ongoing queries and only run the current (or the latest) query. To achieve that, they used mutex support, which synchronizes multiple concurrent requests performed by the Cube.js API via
In-memory cache and pre-aggregations in Cube.js also helped the COTA team achieve desired performance since the same table can be viewed in different ways based on applications. They are happy with the performance so far; however, they also experienced that pre-aggregations is likely one of the more complicated features in Cube.js. Ensuring they use all pre-aggregations features correctly required a fair amount of effort and community support on Slack.
The COTA team also employs dynamic schema generation with zero-setup
originalSql pre-aggregations to materialize results for every
ProductID pair of dimensions. This approach significantly reduces the response time for their per-customer or per-product queries:
The COTA team also provided early feedback on the advanced boolean logic, as this feature made it easier for the team to read and write code. Before the advanced boolean logic, it wasn't easy to do complex nested queries, so they used multiple queries by getting an inner query result and computing another query on that result set. With the advanced boolean logic, they took advantage of the Angular-QueryBuilder to create complex logic to get a result with a single API call.
For the Cube.js implementation at COTA, there were 4 people involved: a product manager, a data analyst, and two software engineers. The release of the minimum viable product (MVP) for their RWA product took about 6-8 months.
As the COTA team was working on the Cube.js implementation, they took advantage of community support and insights on Slack and the community forum. They also appreciated the ability to file bugs and feature requests on GitHub. More recently, they learned from feature demo discussions during Monthly Community Calls on ways to fine-tune their Cube.js implementations (e.g., optimizing
As areas for improvement in Cube.js, the COTA team would like to see more out-of-the-box Angular support from Cube.js to help with the speed of integration at COTA. For example, implementing
AngularHttpTransport would help them leverage features like
HttpInterceptor to simplify canceling the requests.
Internally, the COTA team also wants to migrate Cube.js to containerized Docker deployments to align with the rest of their infrastructure at the company.
Explore Cube.js examples & tutorials and get started today. To jumpstart your efforts, please join us on Slack, follow us on Twitter, and get engaged with the growing Cube.js community.