Amazon的架构经历了巨大的变化,从一开始时的两层架构,转向了分布式的、去中心化的服务平台,提供许多种不同的应用。
最开始只有一个应用来和后端交互,是用C++来完成的。
架构会随着时间而演进。多年来,Amazon将增容的主要精力放在后端的数据库上,试图让其容纳更多的商品数据,更多的客户数据,更多的订单数据,并让其支持多个国际站点。到2001年,前端应用很明显不能再做任何增容方面的努力了。数据库被分为很多个小部分,围绕每个部分会创建一个服务接口,并且该接口是访问数据的唯一途径。
数据库逐渐演变成共享资源,这样就很难再在全部业务的基础之上进行增容操作了。前端与后端处理的演进受到很大限制,因为他们被太多不同的团队和流程所共享了。
他们的架构是松散耦合的的,并且围绕着服务进行构建。面向服务的架构提供给他们的隔离特性,让他们能够快速、独立地完成许多软件组件的开发。
逐渐地,Amazon拥有了数百个服务,并有若干应用服务器,从服务中聚合信息。生成http://Amazon.com站点页面的应用就位于这样的一台应用服务器之上。提供web服务接口、顾客服务应用以及卖家接口的应用也都是类似的情况。
许多第三方的技术难以适用Amazon这种网站的规模,特别是通讯基础架构技术。它们在一定范围内工作的很好,但是如果范围再扩大的话,它们就不适用了。因此,Amazon只好自己开发相应的基础技术。
不在一种技术上"吊死"。Amazon在有的地方使用jboss/java,不过只是使用servets,并没有完全使用j2ee中所涉及到的技术。
C++开发的程序被用来处理请求。Per/Mason开发的程序用来生成页面中的内容。
Amazon不喜欢采用中间件技术,因为它看起来更像一种框架而不是一个工具。如果采用了某种中间件,那么就会被那种中间件所采用的软件模式所困扰。你也就只能选用他们的软件。如果你想采用不同的软件几乎是不可能的。你被困住了!经常发生的情况就是消息中间件,数据持久层中间件,Ajax等等。它们都太复杂了。如果中间件能够以更小的组件的方式提供,更像一个工具而不是框架,或许对我们的吸引力会更大一些。
SOAP 相关的web解决方案看起来想再次解决所有分布式系统的问题。
Amazon提供SOAP和REST这两种Web 服务。大概有30%的用户采用SOAP这种Web Services。他们看起来似乎是Java和.NET的用户,而且使用WSD来生成远程对象接口。大概有70%的用户使用REST。他们看起来似乎是PHP和PER的用户。
无论采用SOAP还是REST,开发人员都可以得到访问Amazon的对象接口。开发人员想要的是把工作完成,而不需要关心网线上传输的是什么东西。
Amazon想要围绕他们的服务构建一个开放的社区。他们之所以选择Web Services是因为它的简单。事实上它是一个面向服务的体系架构。简单来说,你只有通过接口才能访问到需要的数据,这些接口是用WSD描述的,不过它们采用自己的封装和传输机制。
Amazon's architecture has undergone tremendous changes, from a two-tier architecture at the beginning to a distributed, decentralized service platform that provides many different applications.
Initially, there was only one application to interact with the backend, which was done in C++.
The architecture will evolve over time. For many years, Amazon has focused its main efforts on increasing capacity on the backend database, trying to accommodate more product data, more customer data, more order data, and support multiple international sites. By 2001, it was obvious that the front-end application could no longer make any efforts to increase capacity. The database was divided into many small parts, and a service interface was created around each part, and the interface was the only way to access the data.
The database gradually evolved into a shared resource, which made it difficult to increase capacity on the basis of the entire business. The evolution of front-end and back-end processing was greatly limited because they were shared by too many different teams and processes.
Their architecture is loosely coupled and built around services. The isolation provided by the service-oriented architecture allows them to develop many software components quickly and independently.
Gradually, Amazon has hundreds of services and several application servers that aggregate information from the services. The application that generates the http://Amazon.com site page is located on such an application server. The application that provides web service interfaces, customer service applications, and seller interfaces is similar.
Many third-party technologies are difficult to apply to the scale of Amazon's website, especially communication infrastructure technologies. They work well within a certain scope, but if the scope is expanded, they are not applicable. Therefore, Amazon has to develop the corresponding basic technologies by itself.
Don't "hang" on one technology. Amazon uses jboss/java in some places, but only uses serves, and does not fully use the technologies involved in j2ee.
Programs developed in C++ are used to process requests. Programs developed by Per/Mason are used to generate content in the page.
Amazon does not like to use middleware technology because it looks more like a framework than a tool. If you use a certain type of middleware, you are stuck with the software model that middleware uses. You can only use their software. If you want to use different software, it is almost impossible. You are trapped! What often happens is that message middleware, data persistence layer middleware, Ajax, etc. They are all too complicated. If the middleware can be provided in the form of smaller components, more like a tool rather than a framework, it may be more attractive to us.
SOAP-related web solutions seem to want to solve all distributed system problems again.
Amazon provides two types of web services, SOAP and REST. About 30% of users use SOAP as a web service. They seem to be Java and .NET users, and use WSD to generate remote object interfaces. About 70% of users use REST. They seem to be PHP and PER users.
Whether SOAP or REST is used, developers can get access to Amazon's object interface. Developers want to get the work done without worrying about what is transmitted on the network wire.
Amazon wants to build an open community around their services. They chose Web Services because of its simplicity. In fact, it is a service-oriented architecture. Simply put, you can only access the required data through interfaces. These interfaces are described by WSD, but they use their own encapsulation and transmission mechanisms.