Behind the scenes, Tomatocart has been developed in a server side script language called PHP. It is great at performing the application tasks synchronously.
For every order that you get, TomatoCart needs to perform the following:
- The new order will be inserted into the database.
- A new order created email will be sent to the customer.
The second step will only be performed after completing the first step. It maybe very slow to connect to a SMTP server to send the email due to a bad network. The checkout page for customer is blocked until the email is sent. This is really bad.
We need to find a way to perform the above steps asynchronously. When the customer clicks the order confirm button, the system will just need to insert the order into the database. For sending the email to a customer, it will be performed in the background. So, the create new order action will be completed quickly from customer’s point of view. Learn More