HTAP Summit 2024 session replays are now live!Access Session Replays

This post has been translated and adapted from the original EnterpriseZine article, SB Payment Service Adopts ‘TiDB’ for Payment Systems

SB Payment Service, a member of the SoftBank Group, specializes in payment and financial solutions. It offers a wide range of services, including online and in-store payment options, marketing support, and AI-driven fraud detection. Its systems are integral to numerous businesses, and a system failure could significantly impact both economic activities and societal functions.

Exploring SB Payment Service’s Adoption of Distributed SQL Databases

The rapid growth of online payment services led to increasing demand for highly scalable payment systems. To meet mission-critical requirements, SB Payment Service adopted TiDB, an advanced distributed SQL database.

The SoftBank Group has three companies in the payment sector: PayPay Corporation, PayPay Card Corporation, and SB Payment Service. While PayPay Corporation and PayPay Card Corporation cater to consumer-facing payment services, SB Payment Service primarily focuses on B2B operations. This includes onboarding merchants for payment services, enabling online transactions for e-commerce platforms, and deploying versatile payment terminals in physical stores. Additionally, SB Payment Service issues prepaid cards and manages carrier payment systems in collaboration with SoftBank Corporation.

“We offer a wide variety of payment services,” explained Takashi Takaramoto, Director of System Headquarters. For such a diverse portfolio, having a highly-reliable system infrastructure is essential. Furthermore, as the business grows, scalability becomes increasingly critical. “Online payments handle hundreds of transactions per second. We needed a robust solution capable of managing such demands,” added Takaramoto. “We were very interested in distributed SQL databases as a solution to meet those requirements,” said Junya Suzuki, Head of System Operations Control.

Distributed SQL databases offer the horizontal scalability of NoSQL while maintaining the strong ACID (Atomicity, Consistency, Isolation, Durability) consistency of traditional RDBMSs. Despite their potential, distributed SQL databases are often perceived as complex and not user friendly. This made the team’s process to select a suitable database challenging.

When they began seriously exploring new database technologies around November 2021, a highly regarded distributed database was initially the top choice. “However, that database was incompatible with our existing database engine and had very few domestic use cases, so we ultimately decided not to adopt it,” explained Suzuki. Later, in early 2022, TiDB emerged as a new contender.

Why SB Payment Service Chose TiDB

TiDB not only offers compatibility with MySQL, which is widely used at SB Payment Service, but also has a proven track record within SoftBank Group companies. After gathering information, the SB Payment Service team attended TiDB User Day 2022 to learn more. “What stood out to us the most was the level of enthusiasm from the users at this conference. Seeing users passionately recommend ‘great support’—not as vendors, but as fellow users—made me think, ‘This is the real deal,’ and we decided to try it out right away,” said Suzuki.

At that time, PingCAP had also started offering a cloud-based managed service, TiDB Cloud, which made it possible to use TiDB immediately. As a result, from the end of 2022 into the following year, SB Payment Service launched a PoC to evaluate TiDB. “We verified whether applications running on the existing MySQL-based platform could work with TiDB”, explained Ryutaro Maejima. During the PoC, they also conducted performance tests, comparing TiDB with their existing database under the same configuration to see how it performed.

The verification was conducted through a collaborative effort between platform operation managers and application managers. TiDB was set up in the existing development environment, and tests were carried out using both production-level workloads and additional workloads to apply higher loads. Additionally, failure tests were performed, and with the cooperation of PingCAP, instances were intentionally dropped to thoroughly check how recovery could be achieved.

As a result of the verification, it was confirmed that TiDB could handle a sufficient number of transactions, surpassing the performance of the existing database. Furthermore, the downtime caused by switching the read replica during updates or failures, which was an issue with the existing database, was significantly reduced with TiDB. “The ability to drastically reduce the switch time is a clear strength of TiDB as a distributed SQL database,” said Haine Takano. Regarding compatibility with MySQL, he emphasized that for the applications tested, “We only had to change the database connection to TiDB and verify the SQL execution plans, there was no need to modify any of the code.”

Zero-Downtime Scaling During Failures or Updates

With specifications equivalent to the existing database, TiDB outperformed in terms of performance. Even when Suzuki migrated the application he had built to TiDB, the processing performance was approximately 1.7 times greater than the previous system. Additionally, TiDB’s high compatibility with MySQL meant there was no need to modify the application, which was another key advantage. Most importantly, TiDB significantly reduced the downtime required for recovery during failures or updates.

In terms of easing operational difficulties, Maejima noted, “It will likely be at least three times easier than before.” Daichi Kimura, Acting Promotion Section Chief of System Operations Control, shared that when he saw the results of the failure tests during the evaluation, he thought, “The results were so good that I wondered if we had tested enough.”

Another key advantage of TiDB is its “flexibility in expansion”. In TiDB, the TiDB Cluster, which handles SQL processing, and the TiKV Cluster, which stores data, are independent of each other. As a result, “if the SQL processing load is high, you can expand just the SQL engine, and if you need more capacity, you can expand only the storage. The ability to expand them separately based on needs is a major advantage”, said Maejima.

Based on these factors, SB Payment Service concluded that “TiDB is also effective in the production environment of payment services.” However, the risk of drastically replacing the existing stable payment system was too high. On the other hand, adopting TiDB in a small-scale system with minimal business impact would not allow “TiDB’s strengths to shine,” said Takaramoto. As a result, they decided to implement TiDB in a new payment system where its performance could be fully utilized.

The target is an online payment system that is expected to grow significantly in the future. As it is essential to expand it gradually, TiDB became the ideal choice due to its flexibility in scaling. This new payment system project progressed smoothly, and the cutover to TiDB was successfully completed in October 2023. “This service is probably well-known to everyone in Japan, and the volume of data that can be expected to grow far exceeds what we originally imagined. It is expected to continue growing on an extraordinary scale,” said Takano.

For SB Payment Service, this marked the first project to deploy TiDB in a production environment, and the implementation proceeded smoothly without significant issues. One challenge involved preventing database bloat by efficiently removing unnecessary data from partitioned tables. The team was initially unsure how to achieve this without impacting the system’s performance. However, after consulting PingCAP, they were introduced to the “Dumpling command,” which resolved the issue promptly and effectively.

Maejima praised PingCAP’s support services, describing them as “highly satisfactory from PoC to production.” During failure testing, PingCAP promptly addressed requests to drop service instances—actions typically declined by other cloud vendors. Additionally, they identified and resolved slow query issues in the production system by analyzing internal performance metrics and providing actionable recommendations. “PingCAP monitors performance changes even after the system goes live and alerts us before problems occur, giving us a strong sense of security. Their response speed and attentiveness are truly impressive,” said Takano.

Conclusion

Through various projects, the benefits of TiDB have become increasingly evident. Looking ahead, one team member expressed their aspirations: “I want it to become a widely recognized database product that everyone knows.” Beyond its operational reliability, the current cloud version ensures availability with multi-AZ (Availability Zones). In the future, it is expected to support multi-region configurations, further enhancing its ability to handle site-level failures.

Kimura also highlighted the ease of use of TiDB Cloud, noting that most management tasks within its console can be completed with a single click. Additionally, the integrated monitoring dashboard has revealed inefficiencies and operational issues that were previously unnoticed, providing valuable insights for improving system management.

Following the successful implementation and operation of TiDB in the new payment system, Takaramoto said, “TiDB will be positioned as one of the core databases in our company.” He expressed confidence that as the business grows, the adoption of TiDB across more systems will inevitably increase. To further encourage widespread adoption, he emphasized the importance of PingCAP showcasing additional TiDB use cases, enabling SB Payment Service to leverage these examples and drive market growth.