AnnouncementIntroducing MongoDB 8.0, the fastest MongoDB ever! Read more >
NEWSLearn why MongoDB was named a leader in the 2024 Gartner® Magic Quadrant™ Read the blog >
AnnouncementIntroducing Search Demo Builder, the newest addition to the Atlas Search Playground Learn more >
WEBINARIntroducing Search Demo Builder, the newest addition to the Atlas Search Playground Learn more >

Clarifruit streamlines development and improves application performance with MongoDB Atlas

Photo of a girl inspecting fruit.

INDUSTRY

Computer Software

PRODUCT

MongoDB Atlas
MongoDB Atlas Search

USE CASE

Content Management

CUSTOMER SINCE

2023

Clarifruit, a leading agriculture technology company, is revolutionizing the fresh produce industry with cutting-edge computer vision and digitization technologies. Their goal is to streamline the quality control process for fruits and vegetables, helping everyone from farmers and growers to distributors and retailers accurately determine the quality of their produce. With Clarifruit’s iOS and Android apps for quality control inspectors in the field, and a web app for managers, the company provides comprehensive tools for assessing everything from the size and color of grapes to the quality of their stems.

As Clarifruit rapidly scaled, its existing data infrastructure (which was built on Amazon RDS for MySQL) faced increasing limitations. The company needed a more flexible and scalable database solution, particularly one that could support a multi-cloud strategy. By transitioning to MongoDB Atlas—including using the local experience for MongoDB Atlas Search with Docker—Clarifruit not only enhanced its agility and application performance but also created a better experience for its customers.

Outgrowing legacy relational infrastructure

Initially, Clarifruit used MySQL on Amazon RDS for its backend but moved to MongoDB Atlas to be able to operate in a multi-cloud environment. The company had an opportunity to expand into a new market, but in order to do so, they needed to incorporate Microsoft Azure into their cloud footprint. Clarifruit was able to migrate to MongoDB Atlas on Azure and Atlas on Amazon Web Services (AWS) over just a few short months to take advantage of a scalable, multi-cloud database with a distributed architecture.
“We can iterate more quickly when we’re introducing new features on MongoDB because we’re not bound to a particular schema.”

Luke Thompson, Chief Architect, Clarifruit

Because of the intuitive nature of MongoDB’s document model, it was easy for Clarifruit’s development teams to make the switch from the relational approach they had been accustomed to. They migrated from using EC2 instances and MySQL to a containerized Java application with MongoDB Atlas running on two different clouds. In so doing, the company not only moved to a multi-cloud environment but also modernized and introduced more flexibility into the backend of their application infrastructure

And by moving to MongoDB Atlas, Clarifruit was able to accelerate its pace of innovation. “We can iterate more quickly when we’re introducing new features on MongoDB because we’re not bound to a particular schema,” says Luke Thompson, Chief Architect at Clarifruit. “It’s easier for developers to release new features than it was when we had more rigid schemas. Back then, every time we wanted to make a schema change, we had to go through a process to coordinate between developers and manage the database schema update alongside code updates. This sometimes involved downtime and reduced our service availability.”

Adopting MongoDB Atlas Search

When Clarifruit was just getting started with MongoDB Atlas, they used a basic search implementation with MongoDB Query API to support their search requirements. The search experience within their application allowed end-users to look for specific terms—like the name of a given inspection report—and to filter by different parameters. The team at Clarifruit initially set this up with indexes for filter parameters and used $regex to search.
“MongoDB’s release of local search with the Atlas CLI and Docker was really what tipped us into finally adopting Atlas Search.”

Luke Thompson, Chief Architect, Clarifruit

But as their application scaled and their business grew, Clarifruit found that they had outgrown the simpler $regex search implementation and that MongoDB Atlas Search was a better fit for their performance requirements and search complexity. Once Clarifruit adopted Atlas Search, which is built for multiple parallel index intersections, search performance improved significantly. For example, some searches with the original implementation took up to 15 seconds to execute; following the switch to Atlas Search, search time for those searches dropped to 167 milliseconds. In addition to these more extreme examples at the limit, search performance also improved across the board, with the mean search time taking 103 milliseconds prior to adopting Atlas Search and 56 milliseconds after, an improvement of 46%. The standard deviation also decreased since there was more consistency for search times overall.
Figure 1. Comparing Clarifruit's query performance before and after the adoption of MongoDB Atlas Search.

Figure 1 — Comparing Clarifruit's query performance before and after the adoption of MongoDB Atlas Search

Figure 2. Request numbers in buckets of 100ms before and after the adoption of MongoDB Atlas Search

Figure 2 — Request numbers in buckets of 100ms before and after the adoption of MongoDB Atlas Search

Supporting local search requirements

The creation of a local experience for search use cases with the Atlas CLI and Docker enabled Clarifruit to finally make the switch to Atlas Search. Developers at Clarifruit were accustomed to building and testing code on their local laptops. Thompson says, “We do work offline occasionally,” Thompson says. “But more frequently, we want to be able to run experiments and quickly iterate and test our code locally. It’s easier to do that if you don’t have a dependency on a remote database.”

Now Clarifruit’s developers can easily build and test new features with Atlas Search on their local machines and have confidence that they will sufficiently mirror behavior in production. Development and testing are also simpler and easier for developers throughout the full software development lifecycle. Say, for example, the team at Clarifruit is building a new feature and it wants to add an Atlas Search index. With the local experience for Atlas Search on Docker, they can make a local copy of a test data set, try different Atlas Search indexes, and compare the differences without impacting other developers by using shared resources and without incurring any costs. “MongoDB’s release of local search with the Atlas CLI and Docker was really what tipped us into finally adopting Atlas Search,” Thompson said.

Conclusion

By switching to MongoDB Atlas, including using the local Atlas Search experience on Docker, Clarifruit enhanced its scalability, performance, and development agility, empowering it to better serve its expanding customer base. The move from MySQL to MongoDB Atlas was a game-changer, enabling faster iteration, more reliable search performance, and the flexibility to scale across clouds. With advanced features like Atlas Search and a strong foundation for future enhancements, Clarifruit is well-positioned to continue leading in the agriculture technology industry.
To learn more about MongoDB Atlas Search, please visit the product page. To learn how to create a local MongoDB Atlas deployment using Docker, read our documentation.

What will your story be?

MongoDB will help you find the best solution.