Trước khi lặn vào phần mềm mã hóa, bạn cần phải có một kế hoạch rộng kiến trúc choứng dụng của bạn. Hãy nhớ rằng ứng dụng của kiến trúc là khác biệt rõ rệt từ kiến trúc mạng (ví dụ như, năm lớp Internet kiến trúc thảo luậntrong chương 1). Từ quan điểm của nhà phát triển ứng dụng, các kiến trúc mạng cố định và cung cấp một tập hợp cụ thể của dịch vụ cho ứng dụng. Các ứng dụngkiến trúc, mặt khác, được thiết kế bởi các nhà phát triển ứng dụng và ra làm thế nào các ứng dụng được xây dựng trên các hệ thống kết thúc khác nhau. Trong việc lựa chọn cácứng dụng kiến trúc, một nhà phát triển ứng dụng sẽ có thể vẽ trên một trong haiparadigms kiến trúc chủ yếu được sử dụng trong các ứng dụng mạng hiện đại: Cáckiến trúc máy chủ khách hàng hay kiến trúc peer-to-peer (P2P)Một khách hàng máy chủ kiến trúc, có là một luôn luôn-ngày, được gọi là máy chủ,Dịch vụ mà yêu cầu từ nhiều máy chủ khác, được gọi là khách hàng. Một ví dụ điển hình là cácWeb ứng dụng mà một luôn luôn-on Web server dịch vụ yêu cầu từ trình duyệtchạy trên máy chủ của khách hàng. Khi một máy chủ Web nhận được một yêu cầu cho một đối tượng từ mộtkhách hàng máy chủ lưu trữ, nó phản ứng bằng cách gửi các đối tượng được yêu cầu đến máy chủ lưu trữ khách hàng. Lưu ý rằngvới kiến trúc máy chủ khách hàng, khách hàng không trực tiếp giao tiếp với nhaukhác; Ví dụ, trong ứng dụng Web, hai trình duyệt không trực tiếp giao tiếp. Các đặc trưng khác của kiến trúc máy chủ khách hàng là các máy chủ có mộtfixed, well-known address, called an IP address (which we’ll discuss soon). Becausethe server has a fixed, well-known address, and because the server is always on, aclient can always contact the server by sending a packet to the server’s IP address.Some of the better-known applications with a client-server architecture include theWeb, FTP, Telnet, and e-mail. The client-server architecture is shown in Figure 2.2(a).Often in a client-server application, a single-server host is incapable of keeping upwith all the requests from clients. For example, a popular social-networking site canquickly become overwhelmed if it has only one server handling all of its requests. Forthis reason, a data center, housing a large number of hosts, is often used to create apowerful virtual server. The most popular Internet services—such as search engines(e.g., Google and Bing), Internet commerce (e.g., Amazon and e-Bay), Web-basedemail (e.g., Gmail and Yahoo Mail), social networking (e.g., Facebook and Twitter)—employ one or more data centers. As discussed in Section 1.3.3, Google has 30 to 50data centers distributed around the world, which collectively handle search, YouTube,Gmail, and other services. A data center can have hundreds of thousands of servers,which must be powered and maintained. Additionally, the service providers must payrecurring interconnection and bandwidth costs for sending data from their data centers.In a P2P architecture, there is minimal (or no) reliance on dedicated servers indata centers. Instead the application exploits direct communication between pairs ofintermittently connected hosts, called peers. The peers are not owned by the serviceprovider, but are instead desktops and laptops controlled by users, with most of thepeers residing in homes, universities, and offices. Because the peers communicatewithout passing through a dedicated server, the architecture is called peer-to-peer.Many of today’s most popular and traffic-intensive applications are based on P2Parchitectures. These applications include file sharing (e.g., BitTorrent), peer-assisted
đang được dịch, vui lòng đợi..
