MongoDB is used in a broad collection of use cases and has been especially effective in powering web-facing applications. The platform is well-liked by its loyal user base and well-understood by developers and operators. So, why would you ever want to move on from MongoDB?

In many cases, you won’t. But many of our production customers have either migrated from MongoDB to Aerospike or chosen us in a competitive matchup. I will cover some reasons why people opt for Aerospike over MongoDB or start with MongoDB and move to Aerospike. The choice often boils down to either a question of performance and scale or cost and efficiencies.

Of course, a direct head-to-head comparison between MongoDB and Aerospike is a long and complicated discussion. There is a certain amount of overlap where either product is a reasonable choice, so it’s worthwhile to look at a short blog, MongoDB vs. Aerospike, by one of our consulting engineers and former MongoDB engineer, Naresh Maharaj.

In it, Naresh identifies and busts a number of myths about MongoDB around scaling, mobile, and caching, earning him an honorable mention by former Gartner luminary Merv Adrian:

“I generally dislike vendor blogs about their competitors. Usually, they are very unbalanced, deceptive, and narrowly focused. Kudos today, though, on this Aerospike blog I just came across that takes a fairly balanced view of a competitor, in this case, MongoDB.”

Worth checking out.

So, back to our main topic: when does it make sense to move on from MongoDB (hopefully onto Aerospike)?

Re-engineering your architecture for real-time

high load big data solution reengineering

In his guest blog, Optimizing your database infrastructure costs, Vova Kyrychenko – CTO & co-founder of Xenoss (an Aerospike service partner) – described a customer scenario where their misconfigured cloud infrastructure generated a shocking $72,000 overnight bill. This resulted from 116 billion reads and 33 million writes to their cloud database service. The Xenoss solution was to replace 450 MongoDB servers with 10 Aerospike servers – all while doubling traffic.

How is this possible? Part of the explanation is that Aerospike can field “fat nodes” that can deliver sub-millisecond responses on much more cost-effective hardware using Aerospike’s Hybrid Memory Architecture™. Xenoss architects “substituted the data model that required MongoDB servers with Aerospike‘s node-local in-memory storage for real-time access. This decision significantly increased each server’s performance.”

After Xenoss analyzed the system bottlenecks and completed a complete revamp, the yearly database infrastructure costs went down from $2,500,000 to $144,000. Although it seems like basic server consolidation arithmetic, the reality is a bit more involved.

You should read the blog.

Scale versus Scaling

There is a persistent myth that MongoDB can’t scale. It can. In handling large data volumes (terabytes) and scaling out for distributed applications, MongoDB does just fine. Then why does this perception persist? Because there are some scenarios where MongoDB does run into trouble – not with scale, but with scaling. MongoDB’s website has ample examples of hyper-scale use cases. But the consensus among our experts is that achieving hyper-scale on MongoDB requires careful planning and relatively predictable data volumes.

Let’s look at some scenarios where MongoDB scaling may run into trouble. First, there is the challenge of scaling with predictable latency.

Zonetap GNSS systemZonetap leveraging real-time IoT data for worker safety

In a competitive shootout between Aerospike and MongoDB, visionary workplace safety firm Zonetap chose Aerospike when the initial pilot of their IoT workloads on MongoDB led to unpredictable and non-linear infrastructure costs. Zonetap’s application uses highly accurate GPS/GNSS devices on moving machinery and construction workers to transmit real-time location data to their app to create sound and haptic notifications if a worker strays into a potentially dangerous area. Talk about mission-critical!

During Zonetap’s pilot, MongoDB performed fine on up to 24 devices. Beyond that, performance and latency broke down, and the cost of supporting additional devices – Zonetap requires 1000+ – became unpredictable. If there is something a finance guy doesn’t like to hear, it’s “unpredictable costs.”

Zonetap selected Aerospike to help them achieve their scalability and performance goals with sub-millisecond latency and high throughput. They expect Aerospike to be able to ingest location data for 1000 devices today and deliver real-time reads for a seamless user experience with real-time mapping application capabilities.

For more on this story, check out the webinar Building a Real-time Document Data Store at Scale or the Zonetap case study.

Scaling high throughput document stores

The next scaling issue pertains to high-throughput document stores. MongoDB practically wrote the book on document stores, but the requirements of a document store have gotten much tougher over the years. As I mentioned above, with Zonetap, scaling IoT workloads and guaranteeing sub-millisecond latency is a challenge. Scaling efficiently with very high throughput transactional workloads at low latencies is a related but separate challenge. To be fair, those aren’t the workloads MongoDB was originally designed for, but they are exactly what Aerospike was designed for.

When a leading marketing services company needed to replace a homegrown JSON document store, the firm needed to move from a batch-processing model to a real-time model. They evaluated MongoDB and chose Aerospike for superior throughput with low latencies. In their tests, the loading time of their document store took half a day on Aerospike vs. two weeks with MongoDB. They were able to achieve 5X throughput over MongoDB on half the amount of hardware. The firm is now processing 2.5 billion records per hour, with an SLA of 2 milliseconds.

You should read the case study.

Scaling Costs

Finally, there is the scaling of costs. We saw an example with the Zonetap story where platform engineering teams were not able to predict how much hardware would be needed to manage IoT data in real time for 1000 devices. In a world where everything is measurable and measured, eking out the maximum throughput per dollar of infrastructure is becoming the rule.

A top 5 brokerage firm – known for its robust online and mobile trading platforms and commission-free trades – was growing over 10 percent annually and saw its margin lending business as a growing profit center. But the firm’s IT group was at a crossroads. The combination of an RDBMS and a RAM-based cache fronting a traditional mainframe database was unable to consistently and reliably support ever-growing workloads during trading hours.

The business mandate was to seamlessly service more than 10 million customers and process more than 250 million transactions daily while positioning itself to eventually process 1 billion transactions per day. With the existing infrastructure, this mandate was at risk.

They migrated from an end-of-day batch system to a real-time, customer-facing solution on Aerospike,  significantly improving customer satisfaction while saving $10,000 per day with mainframe offloading. They consolidated a 150-server caching layer with 12 Aerospike servers, resulting in a 90% TCO reduction.

For the margin lending business, the firm created a 100 TB performance management database based on an Aerospike-powered document store. The firm did a detailed TCO study of Aerospike versus MongoDB, which delivered $12M in savings with superior uptime.

Their infrastructure now performs 250 million transactions and 2 million price updates per day with 400% faster throughput on a 300% larger object store. All while achieving data consistency from mainframe to cache.

There’s more to the story in the case study.

MongoDB + Aerospike

Chances are, a majority of MongoDB use cases are fine as they are and may never have the type of throughput, latency, and elastic scaling requirements that the typical Aerospike use cases have. It is more likely that as some MongoDB use cases get pushed to their practical limits, they’ll need to shop around.

Luckily, the challenge of migrating or refactoring MongoDB data and applications to Aerospike is fairly straightforward. Developers will also find a very familiar set of APIs for manipulating JSON document data. And because Aerospike has a long pedigree of powering high-throughput, low-latency workloads at gigabyte-to-petabyte scale, your MongoDB apps can find a safe home with virtually unlimited headroom on Aerospike.