我们如何存储和处理每天数百万的订单

In the real world, after a passenger places a GrabFood order from the Grab App, the merchant-partner will prepare the order. A driver-partner will then collect the food and deliver it to the passenger. Have you ever wondered what happens in the backend system? The Grab Order Platform is a distributed system that processes millions of GrabFood or GrabMart orders every day. This post aims to share the journey of how we designed the database solution that powers the order platform.

在现实世界中,乘客在 Grab App 上下了 GrabFood 的订单后,商家合作伙伴会准备订单。然后,司机伙伴会收集食物并将其送到乘客手中。你有没有想过,在后台系统中会发生什么?Grab 订单平台是一个分布式系统,每天处理数百万份 GrabFood 或 GrabMart 订单。这篇文章旨在分享我们如何设计为订单平台提供动力的数据库解决方案的历程。

Background

背景介绍

What are the design goals when building the database solution? We collected the requirements by analysing query patterns and traffic patterns.

构建数据库解决方案时的设计目标是什么?我们通过分析查询模式和流量模式来收集需求。

Query patterns

查询模式

Here are some important query examples that the Order Platform supports:

以下是订单平台支持的一些重要查询实例。

  1. Write queries:

    写查询。

    a. Create an order.

    a.创建一个订单。

    b. Update an order.

    b.更新一个订单。

  2. Read queries:

    阅读查询。

    a. Get order by id.

    a.按id获取订单。

    b. Get ongoing orders by passenger id.

    b.按乘客身份获取正在进行的订单。

    c. Get historical orders by various conditions.

    c.按各种条件获得历史订单。

    d. Get order statistics (for example, get the number of orders)

    d.获取订单统计数据(例如,获取订单数量)。

We can break down queries into two categories: transactional queries and analytical queries. Transactional queries are critical to online order creation and completion, including the write queries and read queries such as 2a or 2b. Analytical queries like 2c and 2d retrieves historical orders or order statistics on demand. Analytical queries are not essential to the oncall order processing.

我们可以把查询分成两类:交易性查询和分析性查询。事务性查询对在线订单的创建和完成至关重要,包括写查询和读查询,如2a或2b。分析性查询,如2c和2d,按要求检索历史订单或订单统计数据。分析性查询对于随叫随到的订单处理并不重要。

Traffic patterns

交通模式

Grab’s Order Platform processes a significant amount of transaction data every month.

Grab的订单平台每月都会处理大量的交易数据。

During peak hours, the write Queries per Second (QPS) is three times of primary key reads; whilst the r...

开通本站会员,查看完整译文。

trang chủ - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.3. UTC+08:00, 2024-11-28 18:42
浙ICP备14020137号-1 $bản đồ khách truy cập$