system design amazon webpage

http://www.mitbbs.com/article_t/JobHunting/33134433.html
class Product {
     uuid
     List <uuid> pictures;
     List<uuid> merchants;
     //  and a list of other meta data for this product, probably like 
category...
}

each product will have a uuid as prime key.  list of pictures, specified by 
picture's uuid.  list of merchants, specified by merchant's uuid

一个product page上, 其实会有很多API。  拿到了product class后, 通过picture 
的uuid, 去call getThumbnail(pictureuuid)... 通过merchant id和product id, 
可以link到某个merchant selling that product的product page

suggest product其实是要有个ML layer, 这个ML layer有real time training和
historical batch training。。。。

然后这个ML layer会提供个getRelatedProduct API, 给个product uuid, 会给你a 
list of related products

这个product key, 就是front end给你的

比如http://www.amazon.com/gp/product/B007UZNS5W/

简单的说, B007UZNS5W 就是product key,amazon要display page, 就会去call 很
多不同的service的API。这page上不同的section, 基本就是不同amazon组干的活。  
frequently bought together是某个小组搞的API。customer who bought this also 
bought this, 又是一个API, 背后的ML, filter的logic还不一样。

你现在就是要设计一些core, 比如这个product, 有多少个merchant在sell,什么图
片。。。

sql么, 其实就比较烦, 我不大会。。 你自己看看http://code.tutsplus.com/articles/sql-for-beginners-part-3-database-relationships--net-8561。  这里主要就是一个product, 有多个picture ID, 有多个merchant ID

nosql么, 基本就是你class里什么field, 就reflect到table里的。 http://www.datastax.com/dev/blog/cql-in-2-1

Comments

Popular posts from this blog

Amazon OA 763. Partition Labels

1427. Split Array into Fibonacci Sequence

05/25 周一