[Translate books] Moving applications to the cloud on the Microsoft Windows azure platform-2

Source: Internet
Author: User
Tags representational state transfer apache tomcat microsoft iis

Chapter 1 introduces the Windows azure Platform

The Microsoft Windows azure technology platform provides an on-demand, cloud-based computing method. The cloud here refers to the computer resources that exist in one or more data centers. currently, Windows azure has data centers in the United States, Europe, and Asia. developers can use the cloud to deploy and run applications.ProgramAnd data storage. on-premises applications can also use cloud-based resources. for example, an application on a server on-premises, a fat client running on a desktop computer, or a client running on a mobile device, they can all access the data stored in the cloud.

 

The Windows azure platform abstracts hardware resources through virtualization. every application deployed in Windows azure runs on one or more virtual machines. these deployed applications behave like they exist on dedicated physical computers, however, they may share resources such as hard disk space, network I/O, and CPU kernel with other virtual machines on the same physical machine. one of the key advantages of the abstraction layer on physical hardware is portability and scalability. service Virtualization allows him to move between any number of physical entities. microsoft achieved economies of scale by combining virtual technology, product hardware, multi-tenant, and aggregate needs. these generate a higher data center utilization rate, that is, the hardware pay-as-you-go distribution. The next step is to save you money.

Virtualization also allows both vertical and horizontal scalability. vertical scalability means that as demand increases, you can increase the number of resources for each virtual machine, such as the CPU kernel or memory. horizontal scalability means you can add more copies of virtual machines with existing services. all these instances are configured with Server Load balancer at the network layer. Therefore, incoming requests are allocated among these VMS.

At the time of writing this article, the Windows azure platform includes three main components:

    • Windows azure
    • Windows azure Plat-form appfabric
    • SQL azure

 

Windows azure provides the following capabilities:

    • Windows-based application Computing Environment
    • Structured, unstructured data storage, and asynchronous Information Transmission

Windows azure platform appfabric provides two services:

    • Service Bus helps you connect to services in the On-premises or public cloud, ignoring the details of network topology logic.
    • The access control service uses security token for Web Service Management authentication and authorization based on representational state transfer (rest.

SQL Azure is essentially an SQL server in the cloud.

The Platform also includes various management services that allow you to control all these resources. The web-based user interface can also be controlled by programming methods. in most cases, you can use rest-based APIs to define how your services work. most management tasks can be completed through the web portal or through APIS. finally, Microsoft provides a complete set of tools and sdks that allow you to develop and test your applications in a local simulated environment. the local test environment is called "Development fabric ". most tools are integrated into Visual Studio. third-party management tools are also available.

The Windows azure Platform

----------------------------------------

In Windows Azure, the entire computing environment reliably processes requests and stores data. an internal subsystem called "Windows azure fabric controller (FC)" manages all computing and storage resources, deploys new services, and supervises the health status of deployed services. when a service fails, FC will create necessary resources and redeploy the service. another component of Windows Azure is SQL azure. SQL Azure is a relational database in the cloud. in essence, SQL Azure is a huge subset of Microsoft SQL. although SQL Azure is a supplement to Windows azure storage service, they are actually different.

 

While writing this book, Windows azure platform app fabric provides two services: Service Bus and access control services.

Service Bus allows you to connect to applications and services, no matter where these services are. for example, you can connect an on-premises application within the enterprise firewall to a service running on the cloud. it implements common message and communication modes, such as event, one-way message, publish, subscribe, and Remote Procedure Call (RPC) information exchange, there is also a tunnel for the Streamed Data Service.

The access control service allows you to manage identity for rest-based services. it implements a token-issuing service, which also provides the token conversion capability. windows azure platform appfabric is not discussed in this Guide. for more information, refer to reference later in this chapter. remember, Windows azure platform appfabric and Windows azure fabric controller are different.

 

In addition to these components, the Windows azure platform also provides service diagnosis services, such as application health monitoring.

All storage and management subsystems in Windows azure use rest-based interfaces. they don't rely on any.. NET Framework or Windows operating system. any technology that can issue HTTP or HTTPS requests can access windows azure's

Device. typically, applications running in Windows azure have multiple instances. each of these cases runs on a Windows virtual machine created and managed by Windows azure. currently, you cannot access these virtual machines in the same way as using virtual PC or virtual server. windows azure takes control of it for you.

To get started with Windows azure platform, visit http://www.windowsazure.com.

 

Windows azure compute

-------------------------------------------

The application running in Windows Azure is called "hosted service ". typically, a hosted service contains different computing resources. They process information together, communicate with each other, and interact with the external world. the hosted service in Windows azure has two roles available: worker role and web role.

 

Work role is commonCodeHost. they are frequently used to process long-running tasks and non-interactive tasks. but in fact, you can have it store jobs of any kind. work role has been used to even store the entire application platform, such as Microsoft IIS service or Apache Tomcat. windows azure initializes and runs work role for a long time, just like running Windows service.

 

By default, you can think that web role is a special worker role with IIS. Therefore, they can store web applications and Web Services. Icon 1 to describe Web role and worker role.

 

Typically, a Web role instance receives HTTP or HTTPS requests from access ports 80 or 443. these public ports are called "Public endpoints ". all public endpoints are automatically balanced at the network layer. both work role and web role can send TCP connections externally or enable endpoints for incoming connections. in addition to the public endpoint of Server Load balancer, you can also open the internal endpoints between instances. these internal endpoints are neither Load Balancing nor visible to the Internet. internal endpoints can be used for synchronous communication between instances and roles.

 

A Virtual Machine instance running both web role and worker role also runs a Windows azure agent ). this "agent" exposes an API that allows the instance to interact with Windows azure FC. for example, an instance can use an "agent" to traverse all public and internal endpoints of the Virtual Machine instance. These endpoints may be in use by the virtual machine, or used to find the runtime configuration.

 

The Web role of the deployed application can be implemented through ASP. net, Windows Communication Foundation (WCF), or any technology that can work with IIS. for example, you can create a PHP application stored in Windows Azure, because IIS supports this application through fast CGI. fast CGI is a protocol that specifies how to interface with applications in Web server. most Web role applications are optimized for the load in the "request-response" mode. The interval between requests and responses is ideally short.

 

A key metric for Web role is "session management", that is, session management. in the standard ASP. in A. NET application, session state is stored by some methods. for example, an online store stores a shopping cart. similar to the Web server farm, storing session states in the memory of each server instance is scratching the head of a Web role-based site. this is because the user cannot be redirected to the same web role instance every time a request is sent. instead, you will maintain session state information outside the Web role instance, such as Windows azure storage or SQL azure, or the cookie you send back to the client, or in the hidden form element.

The most common application mode in Windows Azure is to allow Web role to accept incoming requests, and then use Windows azure's queue to send these requests to worker role for processing. worker role regularly reads information from queue to check whether there is work to be done. if yes, it starts to execute the task. typically, the Web role will accept the work completed from the persistent storage, such as a blob or a table. figure 2 shows this typical design model.

 

 

This is a simple and common way of interacting between a web role and a worker role, but there are also many other possible ways of interacting. for example, you can use WCF to connect web role and worker role.
another function of "agent" running on Web and worker role is to maintain the heart beat of the system through FC. FC monitors the health status of VMS and physical machines. if the application fails to respond due to an error in the Code, or the underlying hardware of the Instance fails, FC will take any appropriate measures to restore the application. if the application crashes, FC may simply restart the failed instance. in the extreme case of physical layer hardware errors, FC tries to migrate the affected instance to another physical machine in the data center. at any time, FC will try to maintain as many instances as possible. there is no auto-scaling capability yet. you are responsible for the number of computing resources instances in Windows Azure, either through the web portal to control the number, or through the management API.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.