Fast Snap Up

Avatar of Timothy Lee.
Avatar of Timothy Lee.

Fast Snap Up

後端工程師
New Taipei City, Taiwan

速速搶購 - Fast Snap Up

當同一資源被同時讀取和寫入時就會產生資料競爭,直觀上可能會使用mutex lock 來避免此現象,但容易造成 dead lock,透過設定 database 的 transacion level 來讓資料能有序地被控制處理,並達到資料一致性的目的

開發架構流程示意圖

多人搶購相同商品模擬結果


模擬多人搶購相同商品,在資料競爭的情況下,透過設定Database的 transaction level 來達到資料的一致性。
Avatar of the user.
Please login to comment.

Published: Jan 12th 2023
47
6
0

Tools

nginx
nginx
amazonwebservices
Amazon Web Services
bootstrap
Bootstrap
css3
CSS3
html5
HTML5
postgresql
PostgreSQL
express
Express
nodejs
Node.js

Node.js
AWS
Back-end
Transaction
Race condition

Share