Network operators banks × OceanBase: first practice on distributed database application cloud bank

This paper finishing industry since the 2019 Summit large data bank network operators together technical experts Yang Shang (nickname: Gong Bo) speech. This article will take the reader insight into practical application of network operators bank on the financial level of distributed database OceanBase.

1

Commercial Bank's net demand database

With the rapid development of mobile Internet, cloud computing, big data and other information technology, the Internet banking emerged, prompting banks to gradually transition to the Internet mode.

Pratt & Whitney Commercial Bank Network is committed to providing financial services to small and micro enterprises, rural users, general consumers, small and medium financial institutions, from its inception, the proposed low-cost, high availability, high flexibility requirements. In addition, as a strong banking sector supervision, higher regulatory authorities on various occasions have raised the self-control requirements. In order to meet compliance and business development, network operators using the bank's financial self-control level distributed database OceanBase as the core database, and it was constructed based on the bank's first domestic Internet cloud.

2

In these four years, the bank network operators in the scene distributed database validation, migration, security, operation and maintenance aspects of the new system architecture and high availability, etc. have a certain accumulation and precipitation, today and share with everyone about.

Introduction to financial scale distributed database

Financial-level distributed database OceanBase, in the design and implementation process that combines classical techniques in the field of traditional relational database and distributed systems, high performance, high availability, scalability and other features, disaster recovery and capacity to solve problems. OceanBase multi-tenant isolation technology resources, to avoid affecting each other. Meanwhile OceanBase with high compatibility, ease of use in improving the same time, greatly reducing the cost of business migration.

3

Logical Architecture Database

Here to tell us about OceanBase product architecture, OceanBase using Share-Nothing architecture, providing more and more copies of the cluster.

It is a schematic view of the right OceanBase deployment. OceanBase clusters to be deployed at least three copies of the agreement and use paxos maintain data consistency. And has the following capabilities and benefits:

(1) ensure strong consistency between the primary standby database, the data is always consistent;

(2) provides horizontal scalability;

(3) provide room / city level disaster recovery, remote live, automatic fault recovery capability.

4

Let's look back at the history of the development of database architecture bank network operators.

网商银行从建设之初,采用 5 库 10 表的设计。升级到 OceanBase 1.0 后,逻辑架构进行了水平数据拆分,从 5 库 10 表到 100 库 100 表,支持全行业务系统运行在 100 个逻辑单元,最大可支持物理部署在多地的 100 个数据中心进行并行数据处理,用于满足指数级的金融业务增长需求。

5

创新一直是分布式数据库架构发展的源动力,并且始终贯穿在网商银行的技术实践过程中。数据库迁移拆分、秒级弹性数据源等,正是创新技术的体现。

在从 OceanBase 0.5 升级到 OceanBase 1.0 的过程中,物理架构也从两地三中心发展到目前的三地五中心,并逐步形成了一套完整的一站式数据迁移解决方案——OceanBase 迁移服务(OceanBase Migration Service,简称 OMS)。

OMS 是数据库拆分、迁移的利器,适用于在数据库版本升级、等表拆分和1拆多等场景中。无论数据库是同种类型,还是异构,实现了弹性拆分,同时也将影响面控制在最细粒度,可分钟级完成。

6

秒级弹性数据源是针对流水型业务提供了数据源的高可用和弹性能力,使用数据路由策略,将多组物理库配置成 1 个数据源。多组物理库之间互为故障切换(FailOver);可任意切换当前服务的数据库,而不会对业务产生任何影响,切换后在秒级别所在应用立即生效,从而大大拓展了数据库的能力,构建了数据源级别的高可用。

7

总结来说,OceanBase 迁移服务及拆分方案,实现了灵活的数据拆分和合并,以最小的影响,在分钟级完成切换。秒级弹性数据源,可在多套数据库下同时提供服务和自动切换的能力,并且实现了数据源级的自动故障切换(Auto FailOver)。

物理架构演进

物理架构方面,网商银行从原来的两地三中心,发展到三地五中心部署架构。容灾能力上,从容忍单机房挂掉,到城市级宕机。网商银行实现了业务应用上异地多活的能力。这背后是分布式数据库能力的增强,是对高可用的要求,本质上也是对客户体验的极致要求。

为了数据源的高可用,分布式数据库从架构角度,来进行分集群的设计,来降低特殊情况下的影响;伴随业务发展,数据中心的集群需要分摊到更多城市,实现单元化,来降低单集群的容损率。

8

高可用架构是对用户体验的极致追求。网商银行基于 OceanBase 构建了异地多活,每个城市都有全量数据,通过不同数据库的读写点交叉,由多个城市来共同承担用户的流量访问。

在数据库逻辑架构示意图中,应用每次写入数据到主库的同时,会由主库将事务日志强同步到其他的备库,且至少要写成功 2 个备库。

9

下面来举例说明数据库异地多活部署的逻辑架构。通过三地五中心的逻辑架构部署,实现 RPO = 0,RTO 小于 30 秒,单个数据中心或者当个地域故障都能保证数据库高可用并且不丢失数据。

10

下面是数据库逻辑架构下的库级别主从分布的样例。从逻辑架构上可以看出,每个机房都包含全量数据,多个数据库集群同时提供服务,用这种方式降低了单点故障对客户的影响。采用交叉部署的方式,同时提升了机器的资源利用率。

下图中是在单 IDC 故障、城市故障之下,逻辑架构中表的主节点(读写点)自动切换到可用节点上,整个过程 30 秒内完成,即业务 30 秒内可自动恢复。

11

纵观整个业务,在线数据库的关键不在于存储,而在于计算,伴随数据量增大,尽管计算能力够用,但仍需更多的存储空间。为了存储增加而扩大机器数量会导致成本过高,而历史库方案可解决成本过高问题。

历史库降成本有两种方案:

(1)降低在线库机器成本:把数据分成冷数据和热数据,将冷数据放到 sata 上,热数据放到 SSD 上;

(2)通过终态数据进历史库,这样历史库是只读的,降低历史库的全量备份的存储成本,从而节约大量资金。

12

从全生命周期的视角,数据库架构的发展是从全面共享到租户共享,再到集群专享的路线;因此,数据库架构需要高弹性,在资源少的时候共享,资源多的时候独享。

13

为了提升分布式数据库的弹性能力,我们引入了虚拟化的技术。

When the number of hardware resources when a simple scheduling can share up to more hardware, thereby reducing the capacity of a single cluster loss rate, the business impact to a minimum; elasticity architecture means that demand investment, cost savings.

14

As China's first commercial bank core system based on cloud computing architecture, network operators open a new bank banking business model in practice, even without a network, as of June 2018, net Commercial Bank and its predecessor, Ali small loans It has accumulated more than 10 million small and micro enterprises and individual operators to provide loan support.

Select OceanBase five centers three deployment architecture, distributed architecture SOFAStack and other network operators to achieve the bank's ability to live in different places on business applications, which greatly enhanced the system throughput of the whole bank. Meanwhile, with the multi-tenant properties OceanBase provided, the ratio of allocation of resources in accordance with the business strategy and the importance of traffic on the cluster, and achieved the best balance between resource sharing and isolation, greatly reducing the cost of procurement of IT infrastructure .

Banks choose network operators OceanBase three five centers deployment architecture to meet the needs of the Bank's management and use of multi-application system, allowing applications to live on architecture design becomes very simple. These basic services to realize the depth of integration and application platform, not only greatly enhance the efficiency of research and development, at the same time after the combination also supports rapid reconfiguration of the value chain banking, financial services will be fully integrated into the various types of application scenarios.

In addition to the inside after years of grinding and tempered products to different scenarios, at present, OceanBase has landed application in a number of financial institutions, including life insurance health insurance, Changshu Rural Commercial Bank, Bank of Suzhou, Guangdong Rural Credit and other dozens of commercial banks and insurance mechanism.

Outlook

In the financial IT infrastructure, development of distributed databases in disaster recovery, high availability, high elasticity, with increasingly strong product capabilities. Looking ahead, banks expect network operators in the integrated data network, with the ability to innovate, through multiple perspectives of business, application, architecture, data, resources, etc., to achieve intelligent scheduling database, to meet strategic business objectives and financial services continuity.

15

At present, the financial sector are on the way distributed database transformation, and actively explore together with industry colleagues hope, innovation, and strive to expand the boundaries of distributed database application.

Guess you like

Origin yq.aliyun.com/articles/705080