Skip to content

Commit

Permalink
docs: nitpick
Browse files Browse the repository at this point in the history
Signed-off-by: Fawzi Abdulfattah <iifawzie@gmail.com>
  • Loading branch information
iifawzi committed Dec 14, 2023
1 parent 80d17d7 commit a7691f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Anticipating and mitigating Murphy's Law `if anything can go wrong, it will`, th

- Mailing Service Reliability: Proactive measures are in place to address potential issues with sending emails. This includes scenarios where the mailing service is non-operational or the mailing queue experiences downtime.

For the concurrency challenge it depends on a lot of factors, are we expecting an immediate response from the user? or can we `queue` it and respond later with either confirmation or cancellation? or do we need to respond synchronously? I chose to respond synchronously.
For the concurrency challenge it depends on a lot of factors, what the business is expecting? is it required to respond immediately to the user? or can we `queue` it and respond later with either confirmation or cancellation? I chose to respond immediately and synchronously.

to handle this, I used transactions with exclusive locks. All operations involved in processing the order, from checking the ingredient stocks to confirmation, are encapsulated within a transaction. This ensures that either all steps succeed, maintaining data consistency, or the entire transaction fails, preventing inconsistent order confirmations. in addition to that, an exclusive lock is acquired when checking ingredient stocks. This lock ensures that only one order can access and modify the stock data at a time, preventing multiple orders from concurrently depleting the stock. The exclusive lock remains in place until the transaction is committed, safeguarding against race conditions during the critical confirmation phase.

Expand Down

0 comments on commit a7691f7

Please sign in to comment.