去年总结了亚麻和灭他的设计题,这次把地里看到的谷歌设计题整理一下。
2023年 亚麻半年设计和BQ
https://www.1point3acres.com/bbs/thread-1016786-1-1.html
2023年 灭他系统设计半年总结
https://www.1point3acres.com/bbs/thread-1016549-1-1.html
因为分数原因,有足够分数的同学可以贴一下题目。我会根据经验进行解读。
要求设计一个分布式缓存
https://www.1point3acres.com/bbs/thread-1096436-1-1.html
在领英找了一个比较详细的 例子,然后用Chat GPT Highlight,中文是我的解读。 https://www.infoq.com/articles/netflix-global-cache/
Building a Global Caching System at Netflix: A Deep Dive into Global Replication
Key Takeaways
• Global Replication Strategy: Netflix replicates data across four regions, reducing latency and enhancing reliability during regional outages.
• EVCache Caching: EVCache, a distributed key-value store on SSDs, enables linear scalability and resilience, managing huge data volumes.
• Infrastructure Scale: EVCache includes 200 clusters and 22,000 servers, handling 30 million global replication events, 400 million operations per second, and storing around 2 trillion items totaling 14.3 petabytes.
• Client-Initiated Replication: The topology-aware EVCache client manages data routing, reducing server load and supporting flexible replication.
• Efficiency Improvements: Batch compression and a switch to Eureka DNS for service discovery have reduced network costs, enhancing performance.
缓存服务器常见的有Memcached和Redis,Redis更轻量级,适用小数据,比如Json/String。Memcached更适用大文件,比如短视频。这应该是Netflix选择Memcached原因,因为有些视频,比如短视频影片预告需要进行缓存。
(1)replicates在大数据存储比较普遍,主要是用于灾难备份。比如世贸中心被袭击了,整个数据中n node location, availability, data distribution, and network latency, balancing load efficiently.
Efficiency Improvements
• Batch Compression: Reduced network bandwidth by 35%.
• Removing Load Balancers: Shifted from NLBs to Eureka DNS for routing, reducing network costs by 50%.
跨Region的Request,用了Batch Compression,毕竟从东岸到西岸比较远。
Conclusion
Netflix’s global caching solution, driven by EVCache and client-initiated replication, provides a scalable, low-latency infrastructure. Ongoing improvements in replication efficiency, data availability, and cost management ensure Netflix’s infrastructure supports seamless user experiences worldwide.
总结一下,EVCache部署在AWS的环境,Instance/Network都很贵。文中给出了一些Solution,来减少Cost。比如。 欢迎大家给出不同的解读,有问题可以留言。 |