The little ant says:
Here comes the “OB Double 11 Promotion for Actual Combat Sharing” topic that you are all concerned about. This series will systematically introduce the technical principles behind OceanBase’s ant Double 11 support and share with you the actual practice. From platform to architecture to implementation, let’s explore the mysterious technological journey of Ant Double 11!
background
With the booming development of ant business, especially the annual Double 11 promotion to create new peaks, the transaction payment core link has proposed the ability to achieve millions of payments per second in the future. In order to achieve this ambitious goal, especially to improve the database level of distributed scaling capabilities such as native Sharding/distributed transaction optimization, OceanBase 2.0 distributed database was born.
Millions of pay
The traditional database expansion scheme mainly relies on the split of sub-database and sub-table for horizontal expansion. Ant database also has the same idea in the initial stage. Through the LDC unit transformation, the core table splits hundreds of database and hundreds of tables according to the user UID dimension.
However, with the development of business, especially the Double 11 promotion in 2017, the peak demand has far exceeded the maximum capacity of a single library. To solve this problem, we use elastic architecture, that is, two sets of elastic databases are added before the rush, and multiple sets of libraries jointly support the rush peak. Although the elastic architecture solves the demand for increasing capacity, it also has some defects. Data routing, post-maintenance and data supporting facilities are very complicated. OceanBase 2.0 partitioning offers the perfect solution for a more elegant distributed database solution that can support payment spikes in the millions or more using a single library.
Overall architecture of OceanBase 2.0
The principle of analysis
The idea of OceanBase 2.0 partitioning scheme is the same as the traditional split database and table. On the transaction and payment core library, we continue to split each sub-table into multiple partitions based on user UID on the basis of the original hundreds of databases and hundreds of tables. Only one table can be seen at the application end, and the data can be split to an infinite number of machines without the user’s perception, breaking the performance bottleneck of single machine and automatic load balancing. In order to achieve the ability to pay millions.
In addition, OceanBase 2.0 provides the partition group function to combine multiple logical tables used by services (TABLE_1, table_2… Table_n), aggregated on the same server according to the common partition, thus avoiding the additional overhead of distributed transactions.
OceanBase 2.0 partitioning solution
Key points:
- The APP side requests SQL with the partition’s field-UID information (such as the Payment_ID column).
- SQL without partition information is optimized in parallel on the OBServer side.
- OBClient calculates partitions and routes to ensure that the first hop is correctly located to the server where the partition resides, avoiding remote execution.
- The OBServer implements internal partition based on the generated column partition_ID, which does not intrude services.
- The OBServer constraint describes multi-dimensional partitioning and implements partitioning clipping.
Advantages:
- Business friendly: Does not change SQL semantics, application code is not aware of partition information.
- General architecture: constraint function, partition clipping; The OBServer provides back-of-the-envelope access.
- High performance and low cost: The server with low configuration provides automatic load balancing and high resource utilization.
OceanBase 2.0 performance optimization
- Distributed transaction elimination: in partition group mode, the partitions of all tables are stored on the same physical machine based on partition keys.
- Two-phase commit protocol optimization: After a transaction is prepared successfully, the memory does not need to keep the persistent state, but can be queried from the log as required. Commit State persistence is converted to background batch completion.
- Commit Asynchronization: After the asynchronization, the Worker does not wait to continue executing the next request in the queue. After the log persistence succeeds, the Worker asynchronizes the callback.
- Memory allocator optimization: Two layers of mapping are organized to improve performance while supporting large partitions.
- Storage optimization: Data encoding technology to achieve high compression.
Optimization results:
Overall performance Compared with OceanBase 1.4, OceanBase 2.0 improves performance by 50% and saves storage space by 30%.
conclusion
The transaction volume of 2018 Tmall Double 11 Global Carnival exceeded 213.5 billion yuan. OceanBase 2.0 successfully withstood the test, fully supported the core link of Alipay, steadily resisted the peak pressure at 0:00:00, and consolidated the chassis capacity of the three-year strategy of “Millions of Payments”.
OceanBase 2.0 also has many important features, such as distributed global indexes, distributed global consistency snapshots, distributed stored procedures, real-time index implementation, and Flashback. These new features strongly support continuous innovation in different enterprise service scenarios.
Join us
【 Intelligent database development 】
Job Description:
1. Responsible for the application architecture design and implementation of ant Financial database intelligent operation and maintenance platform, making the system systematic and forward-looking, able to quickly discover anomalies and risks, automatically identify causes and repair failure sources/risk points, and achieve self-healing, self-scaling and self-tuning autonomous database goals;
2. Responsible for building the data model of database unified technical risk, business capacity and stability, and using data as the support to drive the development of database intelligent operation and maintenance on core issues such as diagnosis, capacity, high availability and business best practices;
3. Independently completed the system analysis and design of large projects, and was responsible for the research and development of core modules, completed the task of system Code Review, and provided relevant performance and safety suggestions.
【 Database platform front-end development 】
Job Description:
Responsible for the front-end research and development of Ant Financial database DevOps platform products, and provide excellent front-end solutions for the whole set of database products through professional front-end technical capabilities.
[Back-end development of database platform]
Job Description:
1. Responsible for the platform research and development of ant Financial database basic platform, containerization, high availability system and other fields;
2. Continue to optimize system maintenance efficiency, control technical risks and solve problems with engineering ideas through platform thinking;
3. Responsible for the application architecture design and system implementation of ant Financial database intelligent platform, making the system systematic and forward-looking, able to quickly discover business risks and timely control; Independently complete system analysis and design of large projects, and be responsible for core module research and development; Responsible for the completion of the system Code Review task, ensure the validity and correctness of the relevant Code, and can provide performance and safety recommendations through the Code Review.
【 Database SRE】
Job Description:
1. Responsible for the development and construction of database high availability platform system and infrastructure, in pursuit of 100% continuous service availability and second-level failure recovery capability;
2. Responsible for database cost optimization, comprehensively optimizing system performance through new technologies, new products and new solutions;
3. Responsible for the construction of database-related platforms and tools, continuously improve the efficiency of business research and development and system maintenance, and solve problems with engineering ideas;
4. Responsible for database architecture design, and conducted data architecture design together with the business team from the perspective of high availability, high performance and capital loss prevention;
5. Responsible for the database guarantee of the company’s major business activities (such as Double 11/12), committed to making users feel silky smooth;
6. Responsible for the exploration and implementation of new database technologies, such as separation of storage and computation, database containerization, etc.
You can send your resume directly to [email protected], we are waiting for you!
Ant Financial ATEC City Summit · Shanghai
On January 4, 2019, ant Financial ATEC Technology Conference, a frontier exploration journey of fintech, will set sail. Are you ready? Small ants for everyone to prepare a full of benefits, waiting for you to take! To learn more about Ant Financial’s technology opening and ATEC Technology Conference, please search ant Financial’s official website (tech.antfin.com)!
ATEC Technology Conference:
Ant Technology Exploration Conference (ATEC) is Ant Financial’s largest Technology event in China, aiming to share the development trend and implementation of new technologies with its global partners and technical professionals. To bring equal opportunities to the world through the exploration and discussion of advanced and cutting-edge technologies. ATEC convention is always on the road. In the past year, Ant Financial ATEC has traveled to hangzhou, Silicon Valley, Singapore, London and other global fintech hubs. After that, it will visit various domestic fintech hubs to share ant Financial’s cutting-edge fintech insights with local audiences.
ATEC Technology Conference Registration & Benefits:
Tickets for this conference will be audited. Guests fill in their personal information for registration. If they receive the message of successful registration within 3 days after registration, the registration will be deemed successful. The deadline for registration is 24:00 on December 31, 2018.
Little ant also prepared the exclusive welfare invitation code for readers of this account: SF2B3A
What are you waiting for, please click the registration link below, little ants look forward to your arrival ~~
ATEC Registration link:
https://tech.antfin.com/articles/activity/atecshanghai