要学好分布式架构,你首先需要学习一些架构指导性的文章和方法论,即分布式架构设计原则。下面是几篇很不错的文章,值得一读。
  • [Designs, Lessons and Advice from Building Large Distributed Systems](https://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf),Google 杰夫·迪恩(Jeff Dean)2009年一次演讲的PPT。2010年,斯坦福大学请杰夫·迪恩到大学里给他们讲了一节课,你可以在YouTube上看一下,[Building Software Systems At Google and Lessons Learned](https://www.youtube.com/watch?v=modXC5IWTJI) ,其回顾了Google发展的历史。
  • [The Twelve-Factor App](https://12factor.net/) ,如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或软件即服务(SaaS)。12-Factor 为构建SaaS应用提供了方法论,是架构师必读的文章。([中译版](https://12factor.net/zh_cn/))这篇文章在业内的影响力很大,必读!
  • [Notes on Distributed Systems for Young Bloods](http://www.somethingsimilar.com/2013/01/14/notes-on-distributed-systems-for-young-bloods/) ,给准备进入分布式系统领域的人的一些忠告。
  • [On Designing and Deploying Internet-Scale Services](https://www.usenix.org/legacy/event/lisa07/tech/full_papers/hamilton/hamilton_html/index.html)([中译版](http://darktea.github.io/notes/2014/07/23/On-Designing-and-Deploying-Internet-Scale-Services.html)),微软Windows Live服务平台的一些经验性的总结文章,很值得一读。
  • [4 Things to Keep in Mind When Building a Platform for the Enterprise](https://blog.box.com/blog/4-things-to-keep-in-mind-when-building-a-platform-for-the-enterprise/) ,Box平台VP海蒂·威廉姆斯(Heidi Williams)撰写的一篇文章,阐述了为企业构建平台时需要牢记的四件关于软件设计方面的事:1. Design Broadly, Build Narrowly; 2. Platforms Are Powerful and Flexible. Choose wisely what to expose when!;3. Build Incrementally, Get Feedback, and Iterate;4. Create a Platform-first Mentality。文章中有详细的解读,推荐看看。
  • [Principles of Chaos Engineering](https://www.usenix.org/conference/srecon17americas/program/presentation/rosenthal) ,我们知道,Netflix公司有一个叫Chaos Monkey的东西,这个东西会到分布式系统里“瞎搞”,以此来测试系统的健壮和稳定性。这个视频中,Netflix分享了一些软件架构的经验和原则,值得一看。
  • [Building Fast & Resilient Web Applications](https://www.igvita.com/2016/05/20/building-fast-and-resilient-web-applications/) ,伊利亚·格里高利克(Ilya Grigorik)在Google I/O 2016上的一次关于如何通过弹力设计来实现快速和可容错的网站架构的演讲,其中有好些经验分享。
  • [Design for Resiliency](http://highscalability.com/blog/2012/12/31/designing-for-resiliency-will-be-so-2013.html) ,这篇文章带我们全面认识“弹力(Resiliency)”,以及弹力对于系统的重要性,并详细阐述了如何设计和实现系统的弹力。
  • 微软的Azure网站上有一系列的 [Design Principle](https://docs.microsoft.com/en-us/azure/architecture/guide/design-principles/) 的文章,你可以看看这几篇: [Design for Self-healing](https://docs.microsoft.com/en-us/azure/architecture/guide/design-principles/self-healing) 、[Design for Scaling Out](https://docs.microsoft.com/en-us/azure/architecture/guide/design-principles/scale-out) 和 [Design for Evolution](https://docs.microsoft.com/en-us/azure/architecture/guide/design-principles/design-for-evolution) 。
  • [Eventually Consistent](https://www.allthingsdistributed.com/2008/12/eventually_consistent.html) ,AWS CTO维尔纳·沃格尔斯(Werner Vogels)发布在自己Blog上的一篇关于最终一致性的好文。
  • [Writing Code that Scales](https://www.codeproject.com/Articles/151520/Write-Scalable-Code) ,Rackspace的一篇很不错的博文,告诉我们一些很不错的写出高扩展和高性能代码的工程原则。
  • [Automate and Abstract: Lessons from Facebook on Engineering for Scale](https://architecht.io/lessons-from-facebook-on-engineering-for-scale-f5716f0afc7a) ,软件自动化和软件抽象,这是软件工程中最重要的两件事了。通过这篇文章,我们可以看到Facebook的关于这方面的一些经验教训。
  • # 设计模式 有了方法论后,你还需要学习一些比较细节的落地的技术。最好的方式就是学习被前人总结出来的设计模式,虽然设计模式也要分场景,但是设计模式可以让你知道一些套路,这些套路对于我们设计的分布式系统有非常大的帮助,不但可以让我们少走一些弯路,而且还能让我们更为系统和健壮地设计我们的架构。 下面是一些分布式架构设计模式的网站。 首先,需要重点推荐的是微软云平台 Azure 上的设计模式。 [Cloud Design Patterns](https://docs.microsoft.com/en-us/azure/architecture/patterns/) ,这个网站上罗列了分布式设计的各种设计模式,可以说是非常全面和完整。对于每一个模式都有详细的说明,并有对其优缺点的讨论,以及适用场景和不适用场景的说明,实在是一个非常不错的学习分布式设计模式的地方。其中有如下分类。 - [设计模式:可用性](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/availability); - [设计模式:数据管理](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/data-management); - [设计模式:设计和实现](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/design-implementation); - [设计模式:消息](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/messaging); - [设计模式:管理和监控](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/management-monitoring); - [设计模式:性能和扩展](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/performance-scalability); - [设计模式:系统弹力](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/resiliency); - [设计模式:安全](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/security)。 除此之外,还有其它的一些关于分布式系统设计模式的网站和相关资料。
  • [AWS Cloud Pattern](http://en.clouddesignpattern.org/index.php/Main_Page) ,这里收集了AWS云平台的一些设计模式。
  • [Design patterns for container-based distributed systems](https://research.google.com/pubs/archive/45406.pdf) ,这是Google给的一篇论文,其中描述了容器化下的分布式架构的设计模式。
  • [Patterns for distributed systems](https://www.slideshare.net/pagsousa/patterns-fro-distributed-systems) ,这是一个PPT,其中讲了一些分布式系统的架构模式,你可以顺着到Google里去搜索。
  • 我个人觉得微服务也好,SOA也好,都是分布式系统的一部分,这里有两个网站罗列了各种各样的服务架构模式。
  • [A Pattern Language for Micro-Services](http://microservices.io/patterns/index.html) ;
  • [SOA Patterns](http://soapatterns.org/)。
  • 当然,还有我在极客时间上写的那些分布式的设计模式的总结。
  • **弹力设计篇**,内容包括:认识故障和弹力设计、隔离设计、异步通讯设计、幂等性设计、服务的状态、补偿事务、重试设计、熔断设计、限流设计、降级设计、弹力设计总结。
  • **管理设计篇**,内容包括:分布式锁、配置中心、边车模式、服务网格、网关模式、部署升级策略等。
  • **性能设计篇**,内容包括:缓存、异步处理、数据库扩展、秒杀、边缘计算等。
  • # 设计与工程实践 ## 分布式系统的故障测试
  • [FIT: Failure Injection Testing](https://medium.com/netflix-techblog/fit-failure-injection-testing-35d8e2a9bb2) ,Netflix公司的一篇关于做故障注入测试的文章。
  • [Automated Failure Testing](https://medium.com/netflix-techblog/automated-failure-testing-86c1b8bc841f) ,同样来自Netflix公司的自动化故障测试的一篇博文。
  • [Automating Failure Testing Research at Internet Scale](https://people.ucsc.edu/~palvaro/socc16.pdf) ,Netflix公司伙同圣克鲁斯加利福尼亚大学和Gremlin游戏公司一同撰写的一篇论文。
  • ## 弹性伸缩
  • [4 Architecture Issues When Scaling Web Applications: Bottlenecks, Database, CPU, IO](http://highscalability.com/blog/2014/5/12/4-architecture-issues-when-scaling-web-applications-bottlene.html) ,本文讲解了后端程序的主要性能指标,即响应时间和可伸缩性这两者如何能提高的解决方案,讨论了包括纵向和横向扩展,可伸缩架构、负载均衡、数据库的伸缩、CPU密集型和I/O密集型程序的考量等。
  • [Scaling Stateful Objects](http://ithare.com/scaling-stateful-objects/) ,这是一本叫《Development&Deployment of Multiplayer Online Games》书中一章内容的节选,讨论了有状态和无状态的节点如何伸缩的问题。虽然还没有写完,但是可以给你一些很不错的基本概念和想法。
  • [Scale Up vs Scale Out: Hidden Costs](https://blog.codinghorror.com/scaling-up-vs-scaling-out-hidden-costs/) ,Coding Horror上的一篇有趣的文章,详细分析了可伸缩性架构的不同扩展方案(横向扩展或纵向扩展)所带来的成本差异,帮助你更好地选择合理的扩展方案,可以看看。
  • [Best Practices for Scaling Out](https://www.infoq.cn/article/hiXg6WRDjvNE0VNuwzPg) ,OpenShift的一篇讨论Scale out最佳实践的文章。
  • [Scalability Worst Practices](https://www.infoq.com/articles/scalability-worst-practices) ,这篇文章讨论了一些最差实践,你需要小心避免。
  • [Reddit: Lessons Learned From Mistakes Made Scaling To 1 Billion Pageviews A Month](http://highscalability.com/blog/2013/8/26/reddit-lessons-learned-from-mistakes-made-scaling-to-1-billi.html) ,Reddit分享的一些关于系统扩展的经验教训。
  • 下面是几篇关于自动化弹性伸缩的文章。