Imagine a person named Achraf having a pizza shop in Morroco. He started the shop with one chef only. As the days passed, more customers started buying pizza from Achraf's shop. Now which solutions can Achraf try to meet this business requirement?
In this kind of approach, Achraf will increase the salary of the only available chef and tell him to work extra hours. That means here the process is optimized and throughput is increased with the same available resource. This is an example for vertical scaling.
Another way to tackle this business requirement is preparing some items at non peak hours. For, example preparing pizza dough at 4 am when there are no orders. So, the chef can use this pizza dough whenever the order comes at non peak hours.
Imagine the chef falling sick one day, this will badly affect the business of Achraf's pizza shop on that day. This is an example of a single point of failure. So, Achraf decides to hire a backup chef for that day. So, keeping a backup will help to avoid any single point of failure. Resilient means recovering quickly from failures.
Now the business requirement in Achraf's shop increases a lot. So, this time Achraf decides to hire more chefs. For example, he hires 3 main chefs and 7 backup chefs. This is an example for horizontal scaling.
Now Achraf have a single shop with 10 chefs in total. Now out of the 3 main chefs imagine two are specialists in cooking pizza and the one remaining chef is specialist in cooking burger. So, Whenever an order comes this order should go exactly to the person who is specialized in that. This is an example for microservices architecture, where each one's role is defined.
Now imagine a power failure happening in Achraf's shop on a day. To avoid this kind of situation affecting his business, he decides to start another shop which is away from his first shop. In this way, some orders are managed by the second shop. This is an example of a distributed system where partition is done. This makes the system more fault tolerant and this will result in quicker response time.
Imagine a customer placing an order on Achraf's pizza shop website. Now a central system should decide out of the two shops which one receives the order. This will be decided based on different data provided.
The delivery of the order is also dependent on other factors like unexpected accidents, other power failure issues, etc. To keep track of these issues, it is better to keep a log of each activity. Here activities such as analytics, auditing, reporting, and machine learning are carried out.