Minsheng Bank, openGauss, MogDB
Published: 2023-02-24 07:41:12

With the rapid development of domestic digital construction and transformation, the scale and volume of data are increasing year by year. In addition, open source and cloud deployment have become important trends. More and more organizations are beginning to consider replacing existing traditional databases to cope with new and more Complex business requirements.

The replacement of the database will inevitably bring about the relocation of massive data and the migration and transformation of a large number of data processing programs. How to perform smooth and seamless migration and ensure business continuity and data consistency has become an important factor that enterprises have to consider when selecting database replacements.

►Minsheng Bank embraces openGauss

As the first national commercial bank established by private capital in mainland China, Minsheng Bank has always adhered to the original aspiration and mission of "living for the people and co-existing with the people", and is committed to providing customers with professional and modern financial services. The industry explored the road to the construction of modern commercial banks.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t2bouy7quddx78k4b9vx.png)

As we all know, various data information such as users' financial status and transaction records are the "lifeline" of banks, and ensuring their security is the top priority. At the same time, with the diversification, complexity, and Internet-based business development, the centralized traditional commercial database originally deployed by Minsheng Bank can hardly bear the sudden burst of peak pressure, cannot cope with challenges such as mixed loads, and is costly and difficult to expand. The method of piling up resources to ensure business continuity and stability is no longer sustainable. In order to ensure data security, reduce costs and increase efficiency, and meet new business challenges, Minsheng Bank conducted rigorous testing and evaluation of candidate products, and finally selected openGauss with excellent performance to replace and transform the database in key business scenarios .

►Database migration keywords: compatible, stable, continuous

After determining openGauss as a product to replace the original database, a difficult problem facing Minsheng Bank is how to efficiently realize the complete migration of database objects and full data between heterogeneous databases.
The 2021 annual report of Minsheng Bank shows that the number of retail customers of the company (referring to personal customers with normal customer status (including accounts I, II, and III), pure credit card customers, and small and micro enterprise legal person customers) reached 110.1378 million. At the end of the year, the growth rate was 5.41%. With the addition of other types of customers, the total amount of bank business data can be imagined. If the migration is performed purely by hand, the project volume will be huge, which will definitely affect the normal business development of the company. Therefore, customers need mature migration tools to improve the efficiency of heterogeneous database migration.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nh4o8dhdzj8a7nnilr6m.png)
Minsheng Bank mainly migrates data from databases such as Oracle, MySQL, and DB2 to openGauss . Customers require migration tools to be well adapted to different types of databases and integrated into the openGauss ecosystem. It is understood that the amount of data that needs to be migrated by each system ranges from tens of GB to tens of TB. After the migration is completed, all data must be complete and accurate to ensure availability. In addition, in order to provide better services to bank customers, the migration process needs to ensure system stability and business continuity.
Of course, Minsheng Bank also encountered some common problems in database migration, such as SQL syntax conversion. During the migration process, SQL-related database objects, such as tables, storage, and functions, may be incompatible. The migration tool must accurately identify incompatible SQL.
►

MTK escorts the smooth replacement of openGauss

In fact, in order to make the database replacement go far and steadily, Minsheng Bank adopts a safe three-party cooperation model for system construction . The bank is responsible for database product testing, application transformation, and online operation and maintenance; the openGauss community is mainly responsible for database core function development and ecological construction; Yunhe Enmo, as a third-party manufacturer, is responsible for product defect repair, technical support, and peripheral tool development. is one of them .
MTK is a database migration tool (Database Migration Toolkit) for the cloud and Enmo database MogDB. Since MogDB is an enterprise-level relational database commercial release based on the openGauss kernel, MTK has natural advantages in adaptation and compatibility when it comes to migration tasks that use openGauss as the target library. In addition, MTK supports database migration with Oracle, DB2, and MySQL source databases, which can be said to perfectly match the migration needs of Minsheng Bank and become a powerful tool to promote customer database replacement.
After MTK is deployed in the Minsheng Bank system, it only needs to execute six commands to complete the migration task , specifically:
1. Check the configuration file: ./mtk -c config.json config-check, check the file for syntax errors.

2. Pre-migration test: ./mtk -c config.json --preRun , check possible problems in the migration process in advance, and estimate the time to complete the entire migration task, so as to coordinate the time window for suspending the business.

Next, Minsheng Bank migrated step by step according to its own business needs to accurately locate problems during the migration process and reduce the impact of the migration task on the system.
3. Table structure: ./mtk -c config.json mig-tab-pre

4. Data migration: ./mtk -c config.json mig-tab-data

5. Index/constraint object migration: ./mtk -c config.json mig-tab-post

6. Stored procedure/function migration: ./mtk -c config.json mig-tab-other

To solve the problem of SQL syntax conversion in database migration, MTK has embedded multiple SQL rules, and has realized most of the syntax conversion . In addition, in order to facilitate users to intuitively understand the migration status and problems encountered in the migration, an HTML report will be generated after the MTK parameter configuration reportFile , with detailed content, shows the SQL statement of each step in the migration process, and the user can directly view the problem SQL and modify it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q2qisr2m79ha9u9nei86.png)
MTK's work of migrating data from Oracle, DB2 and other databases to openGauss has been recognized by Minsheng Bank. During the entire migration process, MTK performed stably, maintaining a migration speed of 1TB per hour, ensuring data consistency and smooth business operation . By the end of 2022, Yunhe Enmo has completed the task of migrating 100 sets of heterogeneous databases to openGauss for Minsheng Bank .
See kung fu in the subtleties, and strive for excellence in the extreme. Data is the top priority of the business system, ensuring zero data loss, instant data access and data security are the key points in the process of database migration. In fact, besides MTK, Cloud and Enmo's Migrate to openGauss / MogDB solution also includes SQL compatibility assessment tool SCA before heterogeneous database migration, data consistency verification tool MVD, and heterogeneous data synchronization tool MDB . Through the continuous innovation of the MogDB database and its supporting migration solutions, Yunhe Enmo will continue to promote the smooth progress of the database replacement work of Minsheng Bank.