使用新的缓存解决方案,在6周内使Shopify的旗舰应用程序的速度提高20%。

Shop is Shopify’s flagship shopping app. It lets anyone track their packages, find new products, and even plant trees to offset the carbon emissions from their purchases. Since launching in 2019, we’ve quickly grown to serve tens of millions of users. One of the most heavily used features of the app is the home page. It’s the first thing users see when they open Shop. The home page keeps track of people’s orders from the time they click the checkout button to when it’s delivered to their door. This feature brings so much value to our users, but we’ve had some technical challenges scaling this globally. As a result of Shop’s growth, the home feed was taking up a significant amount of our total database load, and was starting to have a user-facing impact.

Shop是Shopify的旗舰购物应用程序。它可以让任何人跟踪他们的包裹,找到新产品,甚至植树以抵消他们购买的碳排放。自2019年推出以来,我们已经迅速发展到为数千万的用户服务。该应用程序使用量最大的功能之一是主页。它是用户打开Shop时看到的第一件事。主页记录了人们的订单,从他们点击结账按钮到送货上门的整个过程。这个功能给我们的用户带来了很大的价值,但我们在全球范围内扩展这个功能时遇到了一些技术挑战。由于商店的增长,主页反馈占用了我们总数据库负载的很大一部分,并开始对用户产生影响。

We prototyped a few solutions to fix this load issue and ended up building a custom write-through cache for the home feed. This was a huge success—after about six weeks of engineering work, we built a custom caching solution that reduced database load by 15% and overall app latency by about 20%.

我们设计了一些解决方案来解决这个负载问题,最后为主页建立了一个自定义的写通缓存。这是一个巨大的成功--经过大约六周的工程工作,我们建立了一个定制的缓存解决方案,将数据库负载降低了15%,整个应用程序的延迟降低了约20%。

Identifying The Problem

识别问题

The main screen of the Shop app is the most used feature. Serving the feed is complex as it requires aggregating orders from millions of Shopify and non-Shopify merchants in addition to handling tracking data from dozens of carriers. Due to a variety of factors, loading and merging this data is both computationally expensive and quite slow. Before we started this project, 30% of Shop’s database load was from the home feed. This load didn’t only affect the home feed, it affected performance on all aspects of the application.

商店应用程序的主屏幕是使用最多的功能。服务馈送是复杂的,因为它需要汇总来自数百万Shopify和非Shopify商家的订单,此外还要处理来自几十个...

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

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.125.1. UTC+08:00, 2024-05-16 02:23
浙ICP备14020137号-1 $访客地图$