[Bank of Beijing & TiDB] Exploration and Practice of the New Generation Distributed Database

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 【北京银行 & TiDB】新一代分布式数据库的探索与实践

| username: Billmay表妹

Introduction

As business scales up, traditional databases face numerous limitations, and distributed databases have become the solution. This article introduces Beijing Bank’s exploration of distributed database technology during its digital transformation, sharing the application journey and future outlook of TiDB at Beijing Bank.

This article is based on the speech by Mr. Luo Shuihua from the Beijing Bank Software Development Center at the PingCAP 2023 User Summit, with application scenario content written by PingCAP Solution Architect Liu Chang.


As the largest city commercial bank in China, Beijing Bank adheres to digital transformation to lead the development model, business structure, customer structure, operational capabilities, and management methods. The construction of a distributed database is an important part of Beijing Bank’s digital transformation.

In the context of digital transformation under new eras, new regulations, new business forms, and new models, the continuous upgrading and improvement of regulatory requirements bring new demands to the banking industry. Banks must continuously innovate products, refine management, and optimize processes to cope with changes in the operating environment. With the financial environment becoming more inclusive and open, the continuous emergence of social financial service innovations, and the diversification of market competition entities, the financial environment market competition is becoming more intense. The push of the digital wave and the rapid rise of financial technology are building an open ecosystem, becoming a new trend in the banking industry.

In 2023, the number of Beijing Bank’s customers exceeded 100 million. With the continuous rise in the number of customers, accounts, and business transactions, traditional databases encountered many limitations, such as large-scale data storage and the continuous rise of transaction TPS. Promoting distributed database technology to solve the pain points of traditional databases has become a key point in advancing digital transformation.


To adapt to the trend of the digital era and meet the needs of digital transformation in the financial industry, Beijing Bank took the first step in 2017 to explore distributed databases. Through thorough research and testing, the TiDB database won the selection of Beijing Bank in 2017 with its native distributed architecture, one-click scaling, non-intrusive application, and MySQL compatibility. In 2018, Beijing Bank launched the UnionPay cardless payment system and the Jingxin Chain system based on TiDB. As of July 2023, Beijing Bank has launched 198 TiDB data nodes, with a total of 17,952 micro-core scale TiDB clusters, and has put 20 important business platforms into production.


Distributed Financial Business Platform is a new financial business platform built by Beijing Bank based on TiDB. Through TiDB’s multi-user shared resource mechanism, it constructs multiple microservice architectures such as query services, data monitoring, and risk prevention, providing customers with services such as deposits and queries. Since 2018, the distributed financial business platform has successively connected to multiple core financial business scenarios such as the UnionPay payment clearing platform, UnionPay cardless quick payment platform, financial service interconnection platform, and online loan business platform. The platform fully utilizes TiDB’s HTAP hybrid business processing capabilities to achieve isolation of online business and online analysis business, supporting data tables with over 8 billion+ records and supporting internet financial business for over 100 million customers, meeting the different scenario needs of online business and real-time analysis applications.

Historical Detail Query Platform synchronizes transaction detail records and other information generated by various components of the core system (such as debit cards, personal deposits, corporate deposits, personal loans, corporate loans, etc.) to the historical detail query system in near real-time, providing account information query and historical detail query services for mobile banking, online banking, and counter terminals. The historical detail query platform built based on the distributed database TiDB integrates and supplies data from dozens of business systems at the hundred TB level, meeting the high availability, high concurrency, and high elasticity needs of multiple business applications. An innovative HTAP database simplifies the original big data technology stack, stably supporting the elastic storage of massive transaction data for over 10 years. The platform has the capabilities of large-scale real-time multi-source aggregation, high-timeliness stream computing, and complex analysis of large data volumes, providing high concurrency, multi-dimensional data access, and real-time analysis services for customers and ecosystem partners.

Internet Wealth Management carries the traffic of various internet agency sales channels for wealth management business, providing asset and product dimension management, customer dimension wealth management contract management, and operations related to account opening, customer information, and payment related to internal systems, as well as transaction confirmation, reconciliation, and clearing and settlement operations related to external institutions. To meet customers’ diversified investment needs, Beijing Bank offers multiple exclusive wealth management products, creating a product shelf with a variety of types, diverse terms, and convenient purchases. Internet wealth management belongs to the OLTP type system, and the system and data capacity require elastic expansion capabilities. The data model has obvious multi-dimensional characteristics. TiDB provides a hybrid processing method of online and batch processing. The OLTP part mainly provides services to internal and external channels through APIs or files, while the OLAP part mainly integrates with the big data system through data and file exchange methods.

UnionPay Payment Clearing Platform is a new platform independent of existing interbank payment clearing institutions. According to the requirements of the People’s Bank of China to “cut off direct connections,” Beijing Bank integrated its business and systems, developing the UnionPay payment clearing platform based on the TiDB distributed database, providing functions such as online message processing and batch reconciliation processing, achieving the processing capability of “cutting off direct connections” and aggregating third-party payments. Beijing Bank took the lead in using a domestic distributed database to replace traditional centralized databases in the UnionPay payment scenario, meeting the rapid business development needs through TiDB’s elastic scaling capabilities in the case of a surge in transaction volume and data volume, and being transparent and imperceptible to applications.

Minsheng Card Platform carries the Beijing Minsheng Card business. The Beijing Minsheng Card is a new type of social security comprehensive service card issued by Beijing Bank under the supervision of the Beijing Development and Reform Commission, with multiple functions such as social security, benefit distribution, medical health, park annual pass, and financial services. TiDB supports operations such as counter application, card issuance, card production, loss reporting, and account cancellation for the all-in-one card, and provides personal card information query and municipal unit information query functions. TiDB achieves unified data storage, providing high concurrency data query, analysis, push, and distribution services with different dimensions and flexible conditions for Minsheng Card users through multi-dimensional data access and dynamic balance of data hotspots, providing external database services with a unified data view, creating an ultimate digital user experience.

Beijing Bank’s TiDB cluster adopts a two-city, three-center high-availability five-replica architecture. Taking the UnionPay system as an example, a distributed database cluster is built across machine rooms in the same city in Hepingli and Shunyi two IDC, with two replicas deployed in each IDC, and a single replica in Xi’an IDC for remote data synchronization, not carrying business, while a cluster is built in Shunyi for local disaster recovery. The Hepingli and Shunyi two main machine rooms and the Xi’an remote backup machine room adopt a 2-2-1 model, providing real-time data services to front-end business through four replicas in Beijing. This architecture can efficiently support online transaction-type business. Currently, the transaction number of the largest record table has exceeded 2 billion, fully meeting the high-performance requirements of financial business.


In the future, Beijing Bank will continue to promote the technical research and application promotion of domestic distributed databases. First, expand application scenarios, expand the application scope of distributed databases within Beijing Bank, gradually replace foreign commercial databases, and prioritize the use of distributed databases for new systems. Second, continue to enhance value returns, fully utilizing the architecture of distributed databases to enhance differentiated financial service capabilities. In the future, continuously explore and practice, better grasp the characteristics of TiDB, fully utilize TiDB’s scaling and HTAP capabilities, and quickly meet the ever-changing business needs, such as real-time marketing and instant high concurrency scenarios.

In the process of applying TiDB, Beijing Bank is also continuously exploring best practices for seamless version upgrades. In 2022, Beijing Bank upgraded the original stock TiDB databases from versions 2.0, 3.0, etc., to TiDB 4.0, thereby obtaining new functional features and achieving better improvements in stability and performance. In the process of applying distributed databases, Beijing Bank actively promotes the construction of standards and standardization related to distributed databases, cultivating a group of professional talents in distributed database design, development, and operation and maintenance.

Distributed databases have painted a digital blueprint for Beijing Bank’s success, consolidating digital infrastructure, and achieving a series of breakthroughs in building a digital operation system. This has enabled Beijing Bank to achieve balanced growth in scale and efficiency and laid a solid foundation for entering a new journey. Beijing Bank will fully seize the strategic opportunity of digital transformation, anchor the strategic direction, uphold innovation, and accelerate the path to high-quality development.