System Design : What is Asynchronism ?
Motivation
- Deep diving into system design
Asynchronism
- You went to a restaurant and you ordered but the manager told me it will take around 10 hrs to prepare the food come next day.
- I know this is the not the experience you look forward too.
- So there are ways to fix this.
Async 1
- prepare in advance and then serve it when required not viable in all the cases, sometimes cusomter wants something unique and fresh in case of website
- Every user login is somewhat custom to do this approach we have to prerender the html static page with custom data and store it in some kind of CDN
- This is an issue if the user base is too high
Async 2
- A user comes to website and request for some resource that is taking a time this job will be send to some kind of active mq queue and the browser will send back the status to the user that your order is in progress please wait and now the worker threads can check this job is completed or not and once completed it can share the results in a response.
- Check RabbitMQ, ActiveMQ, Redis List for this mechanism .