GOLANG EVERMOS TEST
Contents
Task 1
From the description explained, that the stock error can be caused by accessing the same transaction at the same time, it is clear that the backend service cannot handle this so there is overlap between transactions.
In this test I use 2 techniques to deal with this
-
Using the table locking
if you use this method, if there are overlapping transactions then other transactions will be immediately aborted, this method will not damage the transaction data but will disturb the user
-
Using the queuing technique with a message broker
this method is very good to use, because transactions are queued, transactions will not overlap, the process will be faster because the user does not have to wait until the process is complete, but the system must provide additional notification to the user that a transaction has been successful or not
Requirements
Config
Environment
Config | FilePath | Desciption |
---|
Environment | shop/.env | Database, App & Security Config |
Environment | shop-consumer/.env | Database, App & Security Config |
OAuth2 - Grant Type = Password
Username | Password | ClientId | ClientSecret |
---|
iwan | admin | EVERMOS-SHOP | 923753F2317FC1EE5B52DF23951B1 |
Development
Files
Name | File |
---|
Postman Collection | Evermos - Shop.postman_collection.json |
Postman Environment | Evermos - Shop.postman_environment.json |
ERD | ERD.png |
SQL Database | dump*.sql |
Task 2
the source code for treasure hunt is in the treasure-hunt folder
Don't hesitate to contact if you have any questions