Consider a marketplace like Amazon where millions of products belonging to several thousand
categories are sold. Explain your approach building a system that will provide the following and also consider cross functional teams that could be involved to achieve this.
-Top 100 products based on User rating given a category
-Top 100 products based on Sales given a category
The design itself can focus on how the backend of the application will be designed and the
systems that belong to other teams can just be quoted about their need and how they would be
utilized.
my quick analysis:
We can use order processing micro-service to create events/post messages [orderId, productId, categoryId] into a highly available distributed queue, let some other stream processing micro services consume and apply rules and compute rank for each category and write into some reporting tables [we can use distibuted cache to speed up the process ] .
Another way if the load is too much to handle, we can have partitions of product, categories and let the different process run parallely to compute and rank the top products for each category.
Probable Tech stack: Apache Kafka, Memcache, Micro services