hi. i create cool stuff. eng @use_zypp

heaven
Joined May 2024
Include

Only show posts containing:

Exclude

Hide posts containing:

Time range
-
Minimum likes
about damn time!!!
1
9
170
yooo. you attended the hackathon?
1
1
23
sooo... the two requests can arrive at the same millisecond, but the db row lock would make them go one at a timee. the fiirst one sees [stock=1] and takes it, second one re-checks [stock > 0], sees 0 items left and gets ‘sold out’ so basically no middle layer is needed because the db already does that.
1
21
Replying to @Udoka_AM
oh wait.. db requests can't be concurrent
1
22
Replying to @Udoka_AM
i feel there should be a middle layer that resolves simultaneous requests. if there was one, it would have hit and sent back an error... but if none of them settles, then none of them gets the item. hmmm.. omo 🙃 okay, what if we never get to "1 item left in stock", at least to the users. whenever we get to one remaining, we return it as none left in stock, so there is no possibility of overlapping requests. could even help if someone in the company needs the product 😂
1
46
quite a week i had! unto the next. gm!
2
1
23
389
Replying to @Ignorebysweet
hii. i likeeeeee
9