Step 1: Architecture planning

更新时间:
复制 MD 格式

This topic uses an intra-city active-active geo-redundant architecture as an example to explain how to plan your technical and application architecture. The output includes deployment and application architecture diagrams to guide research and development (R&D) and operations and maintenance (O&M) engineers in initializing the environment and adapting applications.

Prerequisites

For more information, see Cell-based Architecture.

Architecture overview

twoalive

As shown in the preceding figure, this business system is built on an intra-city active-active geo-redundant architecture.

The business architecture covers the following scenarios:

  • Transfers

  • Awarding points for deposits

The applications that support the business are as follows:

  • Transaction center (txnflow): A transaction service center that provides transfer services. It sequentially calls the withdrawal service for the transfer-out account and the deposit service for the transfer-in account, and acts as the initiator of the distributed transaction.

  • Account center (acccenter): Provides two atomic accounting operations, deposit and withdrawal, and is a participant in the distributed transaction.

  • Points center (pointcenter): Provides a point reward service and mainly validates transactional messages.

The main units involved in the deployment architecture are as follows:

  • Two data centers (IDCs): POC01 and POC02.

  • Two regional zones (RZones): RZ01 and RZ02.

    • During normal operations, each RZone manages 50 data shards and handles 50% of the service traffic.

    • You can use LHC Geo-redundant Application Service-Traffic Management to dynamically adjust sharding rules and shift traffic.

  • One global zone (GZone) that consists of two units, GZ01A and GZ01B. These two application layer units are deployed in two separate data centers and serve as backups for each other.

Application architecture

The call chain for the business applications is shown in the following figure.

biztrace

Application sharding

Note

This tutorial does not cover GZone-type applications.

The following three applications are RZone-type applications that can be sharded based on `uid`.

Application name

Zone type

txnflow

RZone

acccenter

RZone

pointcenter

RZone

Data sharding

In this tutorial, the `uid` format is 08006660000****. The data is sharded by `uid` across 10 databases, with 10 tables in each database.

Middleware used

Middleware

Configuration information

Notes

Message Queue

TopicGroupID

Create topics, group IDs, and routing rules.

Data Access Proxy

1 instance with 3 databases, each containing 10 tables

Create an instance, add data nodes, create databases and tables, and connect to the Data Access Proxy.

Distributed Transaction

None

None

Microservice

None

None