A scalable sales and customer journey automation platform built with CockroachDB

How Rapidops built one of the leading sales CRM and automation platforms, Salesmate, with CockroachDB as their distributed database.

About RapidopsChallenges & RequirementsSolution & DeploymentWhat’s Next
  • 99% availability

  • 45 microservices

  • 630+ APIs

  • 3-4 million requests / day

  • 4000+ business customers

  • 250+ background jobs

About Rapidops

Rapidops Inc. is one of the fastest-growing digital strategy, transformation, and innovation companies in the USA. It was founded in 2008 with the goal of helping organizations grow and transform their businesses by leveraging the power of technologies like mobile, cloud, analytics, AI/ML, and IoT.

Their client catalogue spans multiple industries and includes innovative start-ups and Fortune 500 enterprises. Rapidops helps these clients unlock and monetize their digital opportunities, achieve better scalability and efficiency, or drive profitability by delivering tailored digital platforms, experiences, and automations.

Over the years, Rapidops has developed 210+ digital and data-driven products. In addition to the digital products, Rapidops has also built many software platforms that it licenses to its customers. One of their most popular offerings, Salesmate, is a modern sales and customer journey platform that helps businesses to deliver personalized marketing, sales, and services experiences to each customer automatically.

Salesmate customers are getting 3x more deals, 2x more productivity, and reducing costs with its modern and fully integrated customer platform. As this platform grew in popularity, the team at Rapidops ran into several database bottlenecks that pushed them to look for a new solution.

“CockroachDB helped us solve complex business problems and achieve success. Salesmate is just one example where we are using this database. We’ve had a 100% success rate so far, and our engineers are really excited to use it on our other big projects. We are looking forward to growing our partnership with CockroachDB so we can unlock future opportunities and continue to solve complex business challenges.” - Dipesh Patel, Co-Founder and CTO

Challenges & Requirements

Rapidops has a dedicated team of 170+ people comprising software developers, system architects, QAs, and engineers in the US, Canada, and India. They originally built Salesmate on MySQL, but as they grew, they began encountering limitations:

1. Inability to scale reads/writes

Challenge: For Salesmate, they would write to one master node and read from various replica nodes. This replication process caused latency. Additionally, as their workloads grew, they would add MySQL nodes to scale. But, the nodes were not being utilized to their full capacity, which in turn, was not adding any value to the product’s development/deployment.

Requirement: They wanted a database system that gave them the freedom to read/write from any node while taking advantage of ACID transactional guarantees. They also required a database system that could auto-scale to accommodate load fluctuations.

2. Prolonged downtime

Challenge: If (and when) a node went down in a MySQL cluster, it caused downtime until a new master node was elected by the cluster to route traffic to the new node. For example, if the node’s size contained around 2 TB of data, the downtime was about 18 hours. Additionally, MySQL would lock clusters, limit usage to maximum capacity, and take a lot of time to alter tables with multiple rows. All of these factors caused downtime and limited system performance.

Requirement: With a growing system that adds on data at a rapid pace, a longer recovery time was becoming unaffordable for the Rapidops team. They needed a solution that could eliminate (or greatly reduce) downtime through automation and enhanced SQL capabilities.

3. Lack of geo-replication

Challenge: The team reported that achieving geo-replication with MySQL was really tough, and they struggled to do it in a way that didn’t negatively impact performance.

Requirement: They wanted the ability to host the application in multiple regions in the future. For that to happen, they needed a database that could support 100% uptime even when a whole region goes down.

4. Management roadblocks

Challenge: As their database grew, backup and restore with MySQL was not cost-effective since they needed to pass manual scripts for performing backup and restore tasks. Additionally, they were heavily relying on a third-party system for monitoring and altering their system in MySQL to visualize and resolve any issues. This had a negative effect on the system efficiency.

Requirement: They wanted an out of box process solution to accommodate heavy database backups in less time. The team also wanted an easier way to monitor background jobs running in the cluster.

In summary, Rapidops wanted a database system that could counter all of the challenges mentioned above in a more cost-effective manner. Their requirements for a new database system were:

  • Horizontal scaling capability

  • Zero downtime

  • Faster and easier installation and management

  • Efficient backup and restore process

  • Highly distributed database system

  • Automatic failure recovery protocols

  • Easy monitoring of background jobs running in the cluster

  • Uncomplicated and faster table alteration

  • Advanced debugging method

  • Monitoring of node latency

They briefly evaluated YugabyteDB but realized it wasn’t fully featured to support Salesmate. They stumbled upon CockroachDB when looking for a solution that solved all of their problems and could add value to their business model. They liked that they could experiment with CockroachDB Core, which is fully open-source.

Solution & Deployment

After testing on CockroachDB Core in early 2019, they decided to purchase an enterprise license. This decision was based on the positive results they achieved from running real-world scenarios against their test setup.

Being a technology powerhouse, Rapidops’ engineering team has deep experience in building distributed systems, real-time analytics, and data-driven platforms. They clearly knew the challenges they were dealing with and decided to select a platform that would help them not only solve their current challenges, but also for evolving needs for scale, performance, and reliability.

They first deployed CockroachDB in GKE as a 5 node cluster. They took their time testing the performance by starting small and quickly found that it was helping. The ease of debugging and monitoring meant reduced dev efforts for their team. With live monitoring of query performance, they were able to optimize bulk queries which increased their application speed.

Additionally, they really liked the distributed nature of CockroachDB and the fact that it is built on a transactional and strongly consistent key-value store. Another factor that amazed the team was that it could survive disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual disruption.

“Once we experienced how fabulously CockroachDB was handling all the volume and how much the team was enjoying the entire interaction and development phase, we made our decision to start migrating data off of MySQL.” - Dipesh Patel, Co-Founder and CTO

After successfully testing CockroachDB, it was time to start migrating Salesmate workloads off of MySQL. They took a steady approach to migration and started off with small workloads. The ease of use provided by CockroachDB helped them get into production in a relatively short amount of time (around 2 months).

Post initial launch, the Rapidops team mastered CockroachDB’s engine, architecture, and best practices for real-time and high-volume use cases. Initially, they were developing new services on CockroachDB and clubbing it in a hybrid database model. Once they saw how well CockroachDB was handling their volume and how much the team was enjoying the entire interaction and development phase, they started migrating the older data from MySQL in the background. Now they have 8 databases and around 243 tables that are continuously growing, and they feel confident CockroachDB will easily handle the data load.

Rapidops uses a microservices architecture for developing new features for Salesmate on CockroachDB. At present, the Rapidops team has around 45 microservices, 630+ APIs, and 250+ background jobs. More than 60% are running against CockroachDB. This number will keep increasing as they convert old services to CockroachDB and build new services.

Here’s an overview of their current setup:


Their production cluster on CockroachDB consists of 5 nodes that each have 8 virtual CPUs, 64GB RAM, and 1 TB storage capacity. Here are some crucial statistical figures that demonstrate their CockroachDB usage:

  • 1600+ total ranges

  • 380 queries per second running on the cluster at its peak

  • 250 queries per second running on the cluster on an average during business hours

  • Transaction latency:

  • 90th percentile – less than 50ms

  • 99th percentile – less than 500ms

  • 100 connections active on the cluster at any given time

Even with so much activity, the team reports that they have only observed the CPU usage reaching a maximum of 50% and RAM usage reaching a maximum of 28GB. The average network bytes received and sent per second is 95 MiB and 97 MiB, respectively.

What’s Next

Today, Salesmate is an award-winning platform that is being used by over 4,000 sales teams across 70 countries. For the third time this year, Inc. Magazine listed Rapidops in their prestigious Inc. 5000 annual list of fastest-growing companies in the United States.

While Rapidops continues to build the world’s best customer journey platform that scales infinitely to support their growth, it is also a leading technology partner for many Fortune 500 companies, helping them with data strategy, architecture, analytics, and AI initiatives.

Proven by its own implementations and expertise, Rapidops is ready to help their enterprise clients build scalable and distributed analytics solutions on CockroachDB.


Ready to get started?