惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

VTEX’s Tech Blog

How AI-Driven Analysis improved latency by 68% in our main Payment Database Frontend Analytics Staff Engineer: How to find time to work on broader-scope problems Best Practices for Leadership in Critical Incidents Black Friday Tales: Stepping up and Modernizing Orphans Systems Productivity in Software Engineering: Beyond lines of code, the importance of experience in the development cycle VTEX scales to 150 million metrics using Amazon Managed Service for Prometheus Monitoring Windows pods with Prometheus and Grafana
How VTEX improved the shopper experience with Amazon DynamoDB
VTEX Tech Blog · 2024-04-16 · via VTEX’s Tech Blog

In this post, we discuss one of our most recent systems modernization using AWS, which aimed to improve shopping cart latency and increase efficiency on a per-operation basis during the shopping experience.

Shopping cart management is the core of any ecommerce system. It must be simple, fast, and reliable. A shopping cart can vary in size given the different kinds and volumes of information inserted on it, such as items, addresses, and so on.

For several years, VTEX used Amazon Simple Storage Service (Amazon S3) as its primary storage layer for shopping carts. Its reliability and object size limit flexibility were advantages for a long time. For example, a single shopping cart would vary from 1 KB up to 50 MB, with the number of PUT requests over 300,000 per minute during peak traffic hours.

In the ecommerce segment, faster response times lead to higher conversion rates. We wanted to improve both the purchase experience and customer conversion rates.

To accomplish this goal, we evaluated changes to improve the performance of our data storage. We chose Amazon DynamoDB due to its low latency, its managed service capabilities that removed some of the heavy lifting of maintaining database instances, and the fact that DynamoDB was already deployed as part of the company's stack in areas such as data and analytics.

We ran a proof of concept to better understand if DynamoDB would meet our requirements. After a closer evaluation of our data, we realized that some of our shopping cart items were bigger than 400 KB, which is the DynamoDB item size limit.

We reduced our shopping cart data by more than 60% on average with the following strategies:

  • Payload optimization – We removed legacy fields that weren’t used anymore by any API processing or response.

  • Removing default fields – We removed additional unnecessary data from the shopping carts, including null fields. The de-serialization process will create these values on the application side.

  • Compression – We added a compression step before saving it to DynamoDB as a byte array field.

After that, the remaining larger objects (greater than 400 KB) would be offloaded to Amazon S3.

VTEX decided to migrate to the new solution gradually, avoiding unnecessary risks and taking the time to validate associated metrics.

  1. In the initial stage, we wrote data in DynamoDB and Amazon S3 but only read from Amazon S3.

  2. Later, we switched to primarily reading from DynamoDB (fallback readings were still going to Amazon S3) but continued to write on both.

  3. In the third step, we stopped writing in Amazon S3 and used it solely for reading fallback and offloading objects.

  4. Finally, we stopped using Amazon S3 as a fallback for reading and kept it only to store large objects that are larger than DynamoDB items size limit.

The following table shows the type of use for each storage service along the four phases. DynamoDB proved itself as a faster and more efficient solution for our current and near-future use cases.

VTEX had over 4 billion items—70 TB in total—to migrate. Because this was a mission-critical application, the team performed a gradual migration with the help of Amazon S3 TTL. We divided the migration in four different phases.

We wrote the shopping cart elements to DynamoDB and Amazon S3 to prepare for the migration. This allow us evaluate how much capacity we would consume in DynamoDB, as well as its error rate and throttling, and keep writing in Amazon S3 in case of rollback.

We opted to point the application to DynamoDB after 10 days of dual writes while relying on Amazon S3 to handle requests for data older than 10 days. We still wrote in both databases in case of rollback.

We saw consistent latency improvements by adopting DynamoDB for this workload, as shown in the following figure.

We kept replicating writes to Amazon S3 to be prepared in case of rollback. However, when the team became confident that phase two was successful, we stopped writing to Amazon S3. This step has had a tremendous impact on latency while removing the possibility of rolling back to Amazon S3 without losing shopping carts.

The new approach helped us reduce shopping cart API latency by around 30%, as illustrated in the following figure.

Also, in the following AWS Cost and Usage Report (CUR), we ‌see the efficiency gains at this stage.

Finally, we stopped using Amazon S3 as the fallback for reading and just use it to offload files larger than 400 KB. With that, we have the final latency improvement.

In this post, we showed you how VTEX modernized its shopping cart system with Amazon DynamoDB. By doing that, VTEX was able to improve its shopping cart API’s latency by about 30%, improving approximately 70% of its shopping cart storage investments with a smooth and safe migration process.

Managing a solution with millions of requests per minute poses a great technical challenge. It’s crucial that the solution is efficient and reliable, with low latency, in order to apply to the business.

This article was produced in collaboration with AWS. Original post co-written with Alberto Frocht