加拿大华人论坛 美国华人新闻Amazon是如何开始和进行他的SOA旅程的



在加拿大


毕业于Cornell、在高可用、可扩展系统研究方面科班出身的Amazon CTO Werner Vogels的Blog名字就象他在Amazon追求的一样:All Things Distributed。2006年5月,ACM 图灵奖获得者,微软技术院院士Jim Gray拜访了Vogels,然后在ACM Queue发表了他们的谈话。他的这篇文章,让我对Amazon刮目相看。让我侧目的原因是,根据Vogels的说法,Amazon已经在5年前就开始将它的平台结构全面转向SOA(Service-Oriented Architecture),至今已经取得了5年开发、运营的成功经验。所有活跃在当今国际舞台上的外国巨型公司都知道,面对象联想、华为这样的厂商,他们存活的唯一希望就在于他们对大规模、可扩展、高性能、高可用系统的技术的把握。这,就是真正的核心技术。1996年,Amazon起家时,在它的后面是一台网络服务器和一个数据库。到了2001年,随着越来越大的系统规模,Amazon系统的可扩展性已经到了极限。可扩展性和可维护性是软件业永恒的难题。对此,所有的开发者都有着切身体会。面对数十年来延续下来的、全球化团队平行开发、超过百万行的代码和纠缠不清的数据结构,真是令人疯狂,哪才是正确的出路?2001年,面对同样的问题,聪明的Amazon人坐了下来。经过一段严肃的思考,他们开始了世界上第一次大规模的SOA旅程。历史将记住这个时刻。5年以后,微软CTO比尔.盖茨宣布即将退位,他委以重任的接班人正是SOA技术专家Ray Ozzie,由此可见SOA在当今世界的地位。对SOA的定义,下面是Vogels的原话,非常中肯。“For us service orientation means encapsulating the data with the business logic that operates on the data, with the only access through a published service interface. No direct database access is allowed from outside the service, and there’s no data sharing among the services.”目前,Amazon已经这样封装、实现、维护和运营着数百个这样的业务。5年来,Amazon已经从当初的前端网络服务器+后端数据库的两层结构变成了”a fully-distributed, decentralized, services platform serving many different applications”,支撑起了5千5百万用户和1百万合作伙伴。Vogels坦言这一SOA平台是Amazon的战略优势Vogels说,严格的面向业务设计和SOA是获得功能模块隔离(isolation),从而获得可扩展性的杰出方法,能够给开发、运营带来前所未有的Ownership和控制,也给加入更高级的系统可扩展技术以提高整个系统性能,如decentralized request routing 或 distributed request tracking带来了方便。目前,Amazon主要采用的是业务使用-提供这一模式。在Amazon Service内部采用了WSDL之类标准,但使用了优化的传输和marshalling方法,以提高CPU和网络使用效率,对外部客户使用XML feed接口和REST、SOAP接口。据他们统计,使用REST接入Amazon service的客户端一般是基于LAMP的系统,而使用SOAP的一般是基于Java或.NET平台的系统。对于最近比较热门的self-describing XML documents flowing around技术,他坦言:”We are on our way to using this in a number of cases, but we are not there yet. There are advantages, especially when you aggregate services into new services, or when you compose pipelines of services that operate on a message floating through the pipeline. But in many of our cases the contract between consumer and producer clearly defines the messages that will be exchanged, and we can optimize by not using self-describing features”。说明作为一个公司,Amazon更切重实际。令人震撼的是,Amazon不仅将SOA当作其平台的技术架构,更将其整个业务开发流程围绕SOA展开。Vogels直言,这样做非常困难。他提到的几个典型问题是:”How do you make sure that developers are productive in this large distributed service-oriented architecture? If you have this decentralized organization where everybody is developing things in parallel, how can you make sure that all the pieces work together as intended, now and in the future?”。他还特别谈到测试。对此我深有同感。好的测试是软件系统成功的一半,大规模软件系统的测试一直是公司质量和成本管理上巨大的难题,而分布式系统的测试更是一个历史上空前的挑战。任何有些许大规模软件开发经验的人员都知道,Amazon过去5年来组织和实施这样多达数百个业务的大规模开发、维护和运营,意味着怎样的挑战。勇气、决心、远见、创新、智慧、组织管理技巧,这一切都只是家常便饭,无法保证它的最终成功。Vogels将这称为”混沌”(Chaos) 的挑战。他用”生活本不是决定性的”这一哲学思考来进行理解,得到”混沌”不可避免,也无需逃避的结论。他说:”From the outside, the services in our platform may appear chaotic, but chaotic in a good sense-in that we try not to impose a rigid structure on the different functional pieces, but we expect there to be order when looking at it from a different dimension. Thinking about this whole system as a big deterministic system would be unrealistic. Life is not deterministic, and a large-scale distributed system such as Amazon has many organic and emerging properties that can come to life only if you do not constrain it.”。为此,一方面,Vogels要求能够进入Amazon的员工主动、有高度责任感。他说:”The Amazon development environment requires engineers and architects to be very independent creative thinkers. We are building things that nobody else has done before, so you need to be able to think outside the box. You need to have a strong sense of ownership, because in the small teams in which you will work at Amazon, your colleagues will count on you to pull your weight-especially when it comes to operating the service that you have built. Can you take responsibility for making this the best it can be?”。而另一方面,Vogels们一定有他们的实现方式,当然,这是他们的核心商业秘密,他没有透露。因为”混沌”,过去5年Amazon做的一切,本可以轻而易举地变成一场噩梦,但Amazon取得了最后的胜利。为此,它赢得了我的尊重。作为负责技术的官员,和在本是技术访谈的讨论中,Vogels谈论最多的竟是客户,令人对Amazon更加充满信心。在这里,又是SOA使Amazon的技术开发和客户需求几乎完全结合,达到了软件工程需求管理方面的新高度。大多数软件开发人员都知道,对于大规模软件来说,开发人员自己去直接面对客户在客观上、管理上和实现上都几乎难以实现。公司内部必须有详细的分工,才能最后保证高质量地完成哪怕最小的客户需求。而Amazon 的SOA使这一要求成为可能,非常令人启发。为此,他一方面要求Amazon的员工具有强烈的客户意识,并将技术人员两年轮换做客服。他说:”A very important point is whether candidates think the right way about customers and technology. Technology is useless if not used for the greater good of serving the customer. We are a strongly customer-oriented company, and we often use the “working from the customer backwards” approach. This means that in your thought process, you start with the customer and work your way backwards until you have found the simple and minimal technology that you need to satisfy the new customer requirement. It is important that engineers who come to work at Amazon understand that we do not build technology for technology’s sake, but to support the customer.”另一方面,因为Amazon通过将其系统和业务分解为数百个Service展开独立开发和运营管理,使这些Service直接面对终端客户成为可能。具体来说,对于一个新的业务想法,Amazon会首先定义好测量这项业务成功的检验参数,(我想可能是诸如:使客户在网站上的停留时间延长10分钟,购物平均消费提高5%,之类的参数),然后开始以小组的方式进行敏捷开发,迅速开发出系统原型,然后开始回归。他们”try to go into prototype mode pretty quickly, and then you start iterating on that until you feel that you understand your business problem”。在此,SOA的松散耦合业务模型是他们敏捷开发的关键,用Vogels的原话是:”This fast response to new ideas is enabled through the loosely coupled services model, both in technology and at the developer and operations level”。在原型开发完成后,便是疯狂地根据前面定义的测量参数进行无情的测量,以决定新业务的改良和生死。据Vogels说,这导致Service 的开发团队极具有创造力。此外,Vogels个人对开发具有足够的尊重和深刻的理解,他说:”Developers are like artists; they produce their best work if they have the freedom to do so”。能够有人这么说,也值得庆幸了。注:请原谅引用了这么多的英文,因为有些字词难以轻松转译。如有需要,请与我联系。

  ·汽车 问及M7事故,21世纪经济需要转载和销售。
·汽车 我想知道我的情况算肇事逃逸吗?

美国华人新闻-加拿大

富坚义博开通推特

华人网摘要:经漫画家村田雄介和集英社确认,该账号为富坚本人。 图源:twitter 5月23日,推上出现了一个ID为富坚义博的新账号,简介上写着这是一个报告原稿进度的“官方()”并发布了一 ...

美国华人新闻-加拿大

日本议员提议立法禁止AV

华人网摘要:日本立宪民主党众议员堤かなめ在25日众议院内阁委员会上表示,立宪民主党将 "禁止涉及性行为的色情制品 "为目标制定法律。 日本立宪民主党众议员堤かなめ在25日众议院内阁 ...

美国华人新闻-加拿大

师村妙石的创新篆刻作品

华人网摘要:师村妙石,日本著名艺术家、篆刻家、书法家,一直致力于中日友好活动和文化交流,长期专攻中国传统篆刻技法。师村妙石先生曾223次访问中国进行书法研究和文化交流(截至 ...

日本,每年一次全民体检
美国华人新闻-加拿大

日本,每年一次全民体检

华人网关注我,带你看看普通人的日本生活。我家附近每隔两三百米就有一块告示板,类似于国内“居委会”或者“社区”的通知,平时大事小情都能在这里看到。前几天看到了有免费筛查宫 ...

美国华人新闻-加拿大

师村妙石的编著书影

华人网摘要:师村妙石,日本著名艺术家、篆刻家、书法家,一直致力于中日友好活动和文化交流,长期专攻中国传统篆刻技法。师村妙石先生曾223次访问中国进行书法研究和文化交流(截至 ...