Mathpresso: Solving math problems at scale with Cloud SQL databases
About Mathpresso
In 2015, Mathpresso developed 'QANDA', an app that guides users through the process of solving math problems on smartphones. It quickly gained popularity due to the OCR technology that can read letters and formulas to help people solve problems quickly and efficiently. The platform established itself as an educational tool that attracted attention in Korea, but also in global markets, such as Japan and Vietnam. Mathpresso is expanding its services with the dream of becoming an education platform that anyone can easily access to remove educational barriers. It has recently received a large investment in Series C and continues to grow rapidly.
Tell us your challenge. We're here to help.
Contact usMathpresso leveraged Cloud SQL to improve service stability with quicker backup and recovery and improved backend optimization.
Google Cloud results
- Faster backup and recovery, with smooth disaster recovery environment operation
- Stable data processing performance and flexibility in response to traffic
- Establishes a database-centered communication culture with monitoring tools
Builds a scalable integrated learning platform by building a microservice architecture with databases
Mathpresso is an education company known for its artificial intelligence (AI) based learning platform 'QANDA.' QANDA is an app that provides an environment for students to study on their own without having to rely on expensive private education. With QANDA, students simply need to take a picture of a problem they don't understand on their smartphones, and submit it to the app. QANDA immediately provides the solutions and concepts they need to know to answer the problem. It also provides examples of similar problems.
Although the QANDA app was launched to solve math problems, Mathpresso has a bigger goal for digital transformation in education. Students are attracted to private education, such as academies and private tutoring, because they need someone to help them identify their shortcomings and provide guidance to improve on them. Mathpresso believes that it can use data as an alternative.
"QANDA has accumulated data on numerous questions and solution processes over the past eight years. In the beginning, experts had to teach the solution process one-on-one repeatedly, but the problems that students found difficult within a designated curriculum did not differ significantly. "Once a problem is solved, it becomes content that can provide faster and more diverse answers to other students," says Sung-sun Lee, Head of the Mathpresso DBE team.
Lee adds that leveraging optical character recognition (OCR) technology, which reads letters and numbers digitally, Mathpresso has been able to greatly improve its accuracy, thanks to the development of AI vision computing, making it possible to store and manage problems as digital information. To this end, the importance of database clusters that can be systematically operated and managed has been increasing.
"As we continued to scale the business, we found more need for distributed data processing. The database was subdivided more systematically and managed and operated by each project. Previously, we had one large database and operated several services within it, but now we needed to configure each database account to be divided for each service and project."
—Sung-sun Lee, Head of Mathpresso DBE teamBuilding a standalone database suitable for a microservices architecture
Mathpresso recently moved all of its infrastructure to Google Cloud. Currently, the core area of the service has been moved using Google Kubernetes Engine, Compute Engine, and Google Cloud databases, and most of the data pipelines, such as BigQuery for data analysis and Cloud Storage, are operated on Google Cloud.
A major change during Mathpresso's migration process was the database. Initially, QANDA was designed as a monolithic architecture with all services integrated. However, the scale of the service has grown rapidly, with 10 million students around the world studying through QANDA every month. Lee explains that in order to seamlessly develop, update, and operate new technologies, a microservices architecture whereby each element is independent was needed.
"MySQL is still the core of the QANDA database and Cloud SQL has become a tool that allows you to conveniently operate MySQL as a managed service. Cloud SQL's MySQL has the strength of a managed service, but there was also a lot of room for database administrators (DBAs) to make detailed optimizations."
—Sung-sun Lee, Head of Mathpresso DBE team"As we continued to scale the business, we found more need for distributed data processing. The database was subdivided more systematically and managed and operated by each project. Previously, we had one large database and operated several services within it, but now we needed to configure each database account to be divided for each service and project," adds Lee.
Segmenting a database is both technically and operationally challenging for small startups. The separate architecture for each service requires efficient management to ensure that system resources are not excessively insufficient or left over, so in most cases, resources are operated within a single database.
Mathpresso started with a single infrastructure, but as it grew rapidly, it reached a stage where dividing the database was more effective and safer. Lee says that the move to Google Cloud was a good opportunity to take on this significant task, and the Google Cloud environment, including Cloud SQL, was suitable for building a new type of database centered on MySQL.
"MySQL is still the core of the QANDA database and Cloud SQL has become a tool that allows you to conveniently operate MySQL as a managed service. Cloud SQL for MySQL has the strength of a managed service, but there was also a lot of room for database administrators (DBAs) to make detailed optimizations."
As the database was distributed, the way data was accessed also changed. Previously, when an application retrieved data, it would directly access the database and read it. Since moving to Cloud SQL, the structure has changed to communicating through the service API instead of directly accessing the database.
By not accessing the database directly, security has improved and it is better suited to the microservice architecture where data flows through APIs. Above all, because the authority for direct access to the database is clearly distinguished, real-time and single data are maintained even when multiple departments access and work together at the same time, thereby reducing overall confusion. In a single service or business, database-related channels are clearly located in one place.
Seamless communication with an effective monitoring system
The monitoring system greatly helped developers understand the operating status of the database. From the perspective of database engineers, monitoring and response are carried out smoothly through their own database management methods, but it is difficult for service developers to intuitively understand this.
Cloud SQL's query insights showed detailed database statistics at a glance, including most frequently executed queries. Because database engineers are notified in advance of which queries may cause problems in the database before they are mentioned, developers can directly check and respond to specific queries. Confusion between developers and database engineers, which often occurs in the field, is resolved through query insight.
Monitoring largely depends on the capabilities of the DBA. From the DBA's perspective, more specialized and detailed monitoring tools and technologies are needed, but it is not easy for developers to see them directly. Because Query insights allows you to face operational situations in a more casual way, developers can easily get insights into the databases to check their status, and DBAs can separately operate and improve their monitoring tools.
Of course, for companies without a DBA, Query insights becomes a great monitoring tool in itself and creates the foundation for smooth operation without a DBA. Having a professional DBA here serves as a link for smooth communication.
Managed databases where engineers play a prominent role
Trends in databases as well as infrastructure are moving to the cloud. Lee explains that although there is an increasing number of cases where network, switch, and system management are left to the cloud, the database, which is still the core, is an area that requires management with expertise.
"Many businesses still operate without DBAs. Cloud managed database systems, including Cloud SQL, are helping to optimize operations, and one day, AI technology will be added to automatically help with detailed settings such as tuning and advisors. However, database tuning according to rapidly changing traffic still needs to be done by experts," says Lee. "In particular, it is not easy for back-end developers to manage the database with precision. Google Cloud and Cloud SQL have the strength of a managed system and gives DBAs the freedom to perform professional tuning."
"Google Cloud provided ample performance, allowing us to increase the stability of overall operations. The database for Online Transaction Processing (OLTP) services should be operated so that system resource utilization does not exceed 50 percent. Unlike general infrastructure, downtime inevitably occurs when a database scales up, so proper resource management, tuning, and cost must all be satisfied."
—Sung-sun Lee, Head of Mathpresso DBE teamDevelopers still often use the default options provided by the cloud for databases. As a result, settings, such as CPU and memory, are not optimized, and resources may be wasted or bottlenecks may occur. Lee explains that Cloud SQL has a lot of room for database administrators to optimize. In particular, Mathpresso was optimized to reduce the basic load by changing index and database options, and the number of CPU cores and memory could be adjusted to suit each database.
"Google Cloud provided ample performance, allowing us to increase the stability of overall operations. The database for Online Transaction Processing (OLTP) services should be operated so that system resource utilization does not exceed 50 percent. Unlike general infrastructure, downtime inevitably occurs when a database scales up, so proper resource management, tuning, and cost must all be satisfied."
One of the things that doesn't make its presence known when it's running smoothly is the database. Cloud SQL provided an environment that reflected the DBA's intentions and created an optimal environment. Through this, Mathpresso laid the foundation to seamlessly solving the world's 'problems' even in a rapidly growing service environment.
Tell us your challenge. We're here to help.
Contact usAbout Mathpresso
In 2015, Mathpresso developed 'QANDA,' an app that guides users through the process of solving math problems on smartphones. It quickly gained popularity due to the OCR technology that can read letters and formulas to help people solve problems quickly and efficiently. The platform established itself as an educational tool that attracted attention in Korea, but also in global markets, such as Japan and Vietnam. Mathpresso is expanding its services with the dream of becoming an education platform that anyone can easily access to remove educational barriers. It has recently received a large investment in Series C and continues to grow rapidly.