Storage can be for large objects such as video files or small data sets such as databases. 2.2.3 Connectivity. Another common function that cloud providers give ...
Chapter Two Cloud Computing and Web Applications Maha A. Sayal
2.1 Introduction There are many definitions for cloud computing, most companies call their virtual hosting environments clouds because of connotes power, speed, and a scalable property. In reality, a cloud is little more than a cluster of computational and storage resources that have almost limitless of expandability [4]. Cloud computing is receiving a considerable attention in both publications and among users [7, 16]. It is a subscription-based service where customer can get computer resources and networked storage space . One way to give user a view about cloud computing is to consider the experience with email, email client; if it is Yahoo, Gmail, or Hotmail takes care of housing all of the hardware and software necessary to support personal email account. The important part of the situation is to have an internet access. User email is not housed on a personal computer; there must be accessed through an internet connection, and the accesses may be from anywhere to check the email as long as there is an access to the internet, thus the email is different from the software installed on any computer. a cloud computing works like email client . Instead of accessing just the email, the ability to choose what information to be accessed to within the cloud.
In other word, programmers can define cloud computing as an internet based computing where virtual servers provide infrastructure, software, platform, and other resources and hosting to customers on a basis of payment according to use [3], figure(2.1) illustrates the principles of the cloud computing.
7
Figure (2.1) Cloud Computing
2.2 Cloud Services The cloud service is something provided as a utility such as Internet, like that there are multiple classes of utilities, there are multiple classes of cloud services. Cloud services provide so much more than just compute resources. Only three core infrastructure offerings can be called cloud services: compute, storage, and connectivity. Everything else is an adaptation on top of one or more of these utilities.
2.2.1 Compute Cloud computational resources are services that enable user to execute a set of instructions on a physical processor. Access can be provided as a virtual machine, platform or framework, or even an API that enables user to execute code. These services enable user to execute a block of code against input data, which produces output data.
8
2.2.2 Storage Storage can be thought of as the replication of either a file system or a database; it must be persistent and can be either be short term or long term. The data to be saved outside of temporary memory is accessible even if the system user saved it on is restarted or reset. Storage can be for large objects such as video files or small data sets such as databases.
2.2.3 Connectivity Another common function that cloud providers give user is connectivity with services or resources. Sometimes this is transparent, as with having a network adapter on the user compute instance, but sometimes this underlying infrastructure is exposing. The biggest example of a connectivity service is load balancing, in which the user is provided with a single node that can equally direct traffic to his processing nodes and automatically handle node failures.
2.3 Features of Cloud The Consistency , Availability , Partition tolerances (CAP)theorem [17] proposed that there are number of quality attributes that any service could provide two of them, but no system could provide all. These quality attributes are:
2.3.1 Consistency Consistent systems are defined as systems that are either fully operational or not at all. There is no middle ground or partial broadcast. In most every database currently used is consistent. In now a day’s world, when programmer writes something to a database, he expects to instantly retrieve the exactly same data as he just saved. Think of a file system where he save a file and then can instantly read it. Unfortunately, consistent systems are also required for most application. For example, any banking application requires this consistency to perform transactions. Consider the act of performing a purchase, where either customers end money and receive goods, or not. In a consistent system, there’s no way to have the purchase half- finished, where the money is taken but no production is received, or even
9
worse, where to get the product but without payment. This consistency is also a safety feature to prevent unwanted circumstances.
2.3.2 Availability When most people first start their computer, they can immediately open up a web browser and log in to read their email. In today’s world, most users expect to see their email immediately, not as a message starting that their system is currently down and will be up momentarily. Availability is one of the most important quality attributes in web-based systems.
2.3.3 Partition Tolerances One of the most common system deployments is to launch a single database on a massively large central server that everything else connects to. This makes the system consistent. Partition Tolerance is the capability of the system to be fully operational in a partial network outage. To be fully partition – tolerant, the system must behave properly in all cases short of a total network failure. Partition Tolerance almost always goes hand – in – hand with Availability and usually is quite different from Consistency. One common way to achieve partition tolerance is to split the database into multiple different partitions, or segments across to the own network, or even in different networks. This gives an addition advantage that if a single network segment goes down, it shouldn’t take down the whole system [4]. One of the most common patterns in cloud–provider solution is the concept of eventual consistency. As the CAP theorem states, system can have only two of the thre equalities attributes Consistency, Availability, and Partition Tolerance. Most traditional applications use a system that is simply Consistent and not Available or Partition Tolerant. Cloud – based applications trend to Availability and Partition Tolerance and are often not Consistent, at least immediately. Eventual consistency enables to provide constant and highly scalable access to the data, while sacrificing immediate consistency. The transactions are all guaranteed to happen in order, but they may not happen immediately on all nodes in the system. The things cannot be created such as sequential counters, because multiple different nodes may have different 10
values. The only consistent guarantee that eventually exits is that all nodes will come in sync.
2.4 Deployment Models The selection of cloud type is depend on customer's requirements, figure (2.2) demonstrates the four deployment models that will be identified, each with specific characteristics that support the needs of the services and users of the clouds in some particular ways.
Figure (2.2) Public, Private, and Hybrid Cloud Deployment Example • Private Cloud: The cloud infrastructure is operated ,deployed, and maintained for a particular organization. The operation may be with a third- party on the premises. •Community Cloud: The cloud infrastructure is shared among a number of organizations with similar interests and requirements. This may help in limiting the capital expenditure costs for its establishment as the costs are shared among the organizations. Also, the operation may be in-house or with a third party on the premises.
11
• Public Cloud: is available to the public. This cloud enables a consumer to deploy and develop a service in the cloud with little cost compared to traditional expenditure requirements generally associated with other deployment options. • Hybrid Cloud: The cloud infrastructure consists of a number of clouds in any type, but the clouds should have the ability through their interfaces to allow data and/or applications to be moved from one cloud to another. This will be a combination of private and public clouds that support the requirement to retain some data in an organization, and also to offer the need of services in the cloud [18].
2.5 Models’ Service Cloud providers offer their services according to several models’ fundamental as is shown in figure (2.3) they are: Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS), the IaaS is the most basic, and each higher model abstracts fromthe details of the lower models [19,20].
Figure (2.3) Service Models
12
2.5.1 Infrastructure as a Service In the most basic cloud service model, providers of IaaS offer computers – physical or more often virtual machines and other resources. IaaS clouds often provide additional resources such as a raw block storage , virtual machine disk image library, and file or object storage, load balancers, firewalls, Internet Protocol (IP) addresses, Virtual Local Area Networks (VLANs), and software bundles [21]. IaaS cloud providers supply these resources on-demand from their large pools installed in data centers. To deploy their applications, cloud user installs operating system images
that he needs and his
implementation software such as web application on the cloud infrastructure. In this model, the cloud user controls and administrates the operating systems and the all applications software. On a utility computing basis, cloud providers typically bill IaaS services , cost shows the amount of resources consumed and allocated .
2.5.2 Platform as a Service In the PaaS models , cloud providers provide cloud user with computing platform , typically including operating system , execution environment , programming language , web server , and database . Application developers can create , run and develop their software solutions on a cloud platform without the complexity and cost of buying and managing the hardware and software layers. With some PaaS like Google App Engine and Microsoft Azure offers the underlying computer and storage resources scale automatically to match demand of application so that the cloud user does not have to allocate resources manually. The latter has also been proposed by an architecture in a framework to facilitate real-time in cloud environments [22].
2.5.3 Software as a Service Users are provided access to databases and application software . Cloud providers manage the platforms and infrastructure that run the applications. SaaS is sometimes referred 13
to as "on-demand software", and it is usually the payment depends on the use .SaaS providers generally price applications using a subscription fee. In this model, cloud providers operate and install application software in the cloud and cloud users access the software from cloud clients. Cloud users do not manage or control the cloud infrastructure and platform where the application runs. This eliminates the need to run and install the application on the cloud user's own computers, which reduce maintenance and support. Cloud applications are different from traditional applications in their scalability, which can be achieved by copy tasks onto many virtual machines at run-time to meet changing work demand [23]. Load balancers divide the work over the set of virtual machines . This process is not clear to the cloud user, who sees only a single access point . To put a large number of cloud applications , cloud users , can be multitenant, that is, any machine service more than one cloud user organization. The pricing model for SaaS applications is typically a monthly or yearly flat fee per user [24], so price is scalable and adjustable if users are added or removed at any point [25].
2.6 Cloud Computing Works Instead of installing a package of software for each computer, user can load one application. That application would allow workers to log into a Web-based service which hosts all the programs the user would need for doing jobs. Faraway machines owned by another company would run everything from e-mail to processing of words to complex data analysis programs . It 's called cloud computing, and it could change the all computer industry [26]. In a cloud computing system, there's a significant workload shift [27]. Local computers no afford to do all the heavy lifting when it comes to running applications . The computers network that make up the cloud processes them instead . The decrease in Software and hardware demands decrease . The only thing the user's computer needs to be able to run is the cloud computing system 's interface software, which can be easy as a Web browser, and the cloud 's network takes care of the rest. There's a good chance users have already used some form of cloud computing. If user has an e-mail account with a Webbased e-mail service like Hotmail, Yahoo! Mail or Gmail, then he had some experience with cloud computing. Instead of running an e-mail program on personal computer, he logs in to 14
a Web e-mail account remotely. The software and storage for his account doesn't exist on his computer, it's on the service's computer cloud.
2.7 Cloud Architecture Cloud computing architecture consists of two components "the back end" and "the front end" . The front end of the cloud computing system include the client's device or it may be network of computer, and the applications are needed for accessing the cloud computing system. Back end means the cloud itself which may include various computer machines, servers , and data storage systems. Group of these clouds make a whole cloud computing system. The entire system is administered and controlled via a central server that is also used for monitoring client’s demand and traffic guaranteeing smooth functioning of the system. A particular type of software called "Middleware" is used to allow computers that are connected to the network to communicate with each other [3]. If a cloud computing company has many clients, there's likely to be a high demand for a lot of storage space. Some companies require hundreds of storage devices that be a digital devices. The systems of cloud computing need at least twice the number of storage devices it requires to keep all information stored of the client. That's because these devices, like all computers, sometimes break down. A cloud computing system must make a clone of all its clients' information and store it on other devices. The copies enable the central server to reach backup machines to retrieve data that, otherwise; would be unreachable. Making clones of data as a backup is called redundancy [26].
2.8 Characteristics of Cloud Computing Cloud computing exhibits the following characteristics: Agility: improves with ability of users to re-provision technological infrastructure
resources. Application Programming Interface:
accessibility to software that allows
machines to treat with cloud software in the same way that a traditional user interface (e.g., a desktop computer) facilitates interaction between humans and computers.
15
Cost: cloud providers claim that computing costs simplifies : a public-cloud
delivery model makes capital expenditure as a operational expenditure [28]. Third party does not need to be purchased for one-time or infrequent intensive computing tasks. Pricing on a utility computing basis is fine-grained, with usage-based options and fewer IT skills, are required for in-house implementation [29]. Location independence and device : enable users to reach systems using a web browser regardless of their location or what device they use (e.g., PC, or mobile phone). As infrastructure is off-site (typically provided by a third-party) and accessed via the Internet, users can be connected from anywhere [30]. Virtualization: technology increases utilization by allowing sharing of servers and storage devices thus, applications can be easily transferred from one physical server to another. Multitenancy: enables resources sharing and costs across a large pool of users thus, allowing the following to take place: Centralization of infrastructure in locations with lower costs (such as a real state, electricity, etc.) Peak-load capacity increases, i.e. users don’t need an engineer for highest possible load-levels Improvements of utilization and efficiency for systems that are often only 10–20% utilized [31,32]. Reliability improves with the use of multiple redundant sites, which makes well-designed cloud computing suitable for business continuity and disaster recovery [33]. Scalability and elasticity via dynamic ("on-demand") provisioning of resources by depending on the requirements , self-service basis in near real-time [34], without the need to an engineer for peak loads[35]. Security is improved due to data centralization, and increased security-focused resources, but customer is afraid about loss of control over certain sensitive data, and 16
no more security for stored kernels [36]. Security in the cloud is often better than other traditional systems, because providers are able to use resources to solve security issues that many customers cannot afford to tackle [37]. Maintenance of cloud computing applications is easy, because of no need to be installed on each user's computer, thus can be accessed from different places.
2.9 Owncloud The term 'own' refers to running the service yourself , i.e. not being dependent on third-party services like Dropbox. The term of 'Cloud' means a service being on the internet as opposed to on desktop computer or laptop .Because the software is running on a virtual server on the internet the way to reach or find it is through a Uniform Resource Locator (URL) or web link. Owncloud is a web application or a software system for what is commonly termed “file hosting”, figure (2.4) shows its web page. It can serve and store content from a centralized location , it is like Dropbox, with the basic difference being that Owncloud is open-source and free, and thereby allowing everyone to install and operate it without any charge on the private server, with no limits on storage space except for hard disk capacity, or related to the number of connected clients [38].
17
Figure (2.4) OwnCloud Web Interface The main focus of Owncloud is for storing and sharing documents, calendars and contacts in a secure way, which also embraces open standards. There are two main reasons to use Owncloud rather than a similar service like Google Docs or Dropbox. The first reason is that it offers more security for the files that are stored, because they are stored in own server with the ability of encryption. The second reason is that by using Owncloud, more decentralized and less monitored internet are supported. Also Owncloud provides a very usable alternative If there is a need to be comforted about surveillance and the level of analysis of
data
involved in signing up
to corporate internet services. Figure (2.5)
demonstrates an overview for Owncloud [39].
2.9.1 Owncloud’s Features Features of Owncloud includes uploading sites and sharing files, when user logs in Owncloud , user will see an interface for sharing files under the Files menu on the left. he has options for uploading new files, Folders, sites, and for sharing these with other users on personal Owncloud Installation [39].
Figure (2.5) Owncloud Overview
2.10 Web Application 18
A web application (web app) is any application software that runs in a web browser and is created in a browser-supported programming language , such as the combination of JavaScript, Cascading Style Sheets (CSS) , and
Hyper Text Markup
Language (HTML) , and relies on a web browser to appear the application [40]. The ability to maintain and update web applications without installing and distributing software on thousands of client computers is a core reason for their popularity. Web applications are taken from Web sites or Web systems. A Web application builds on and develops a Web system to add business functionality. In its simplest terms , a Web application is a Web system that makes its users to execute business logic with a Web browser. There is a subtle distinction between a Web site and a Web application. A Web application is a Web site where user input (navigation through the site and data entry) affects the state of the business. In essence, a Web application uses a Web site as the front end to an enterprise application. Figure (2.6) illustrates the basic web system.
Figure (2.6) Basic Web System An example for Web Application is Facebook, it gives the ability to create an online profile and interact with others. Profiles and conversations are constantly evolving, so Facebook uses web app technologies throughout the site to keep the information up-to-date. There are games also and other web apps that can add to Facebook profile [41]. Web apps are becoming more and more integrated with websites, and it may be hard to distinguish between a web application and a "regular" website. In many cases, basic user may be using a web application without even knowing it . 19
2.10.1Work of Web Application The user thinks when he uses a web app, he is working from a personal computer or mobile device, but much of the real processing is done by a network of servers. These servers can pool all of their processing power in order to process requests from all over the world. Specialized servers may be used to store the data that users work on, as well as the data from all of the other users. All of this happens seamlessly, so it looks almost like the application is running on a personal computer[1]. For example, if a document is opened with Google Docs, the web browser will communicate with the network of servers to display this document. As the document be edited, the browser will work closely with the servers to make sure everything is kept up-todate.
2.10.2The Problems Faced Web Application The transfer rate is very important especially when a user needs rapid reply in some Web application. The major problem that faces Web application is the low transfer rate that occurs when the loading on server is high; this occurs in limited times because many users need to reply simultaneously, as well as, cost, scalability and high availability[13].
2.10.3 The requirements for Web Application Web application requirements need the following: Computing power Fast temporary storage Large long-term storage Small query able long –term storage Communication between components or modules
2.10.4 Web Applications hosting in the cloud Three types of Web applications are needed in Cloud hosting and are listed below [42]:
Blogs
E- Commerce 20
Forums
2.11 Amazon Web Service for Cloud Services There are companies offer cloud services to users, one of these companies is Amazon Web Service (AWS), of all that cloud providers, AWS offers by far the most services and support. Amazon is the original pioneer into this field and has the largest driving force in that area. It started with only a few services and has grown to now hosting almost everything could be wanted [4,15]. The services that are introduced: Elastic Compute Cloud (EC2) When Amazon jumped into the area of virtualized servers, it started with a simple service built off of Xen (providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently) and took it a level further by adding APIs around common tasks. Unlike traditional virtual servers, these instances launch based on an image. This image is read-only, so the instance makes a copy of the image at the initial boot. After the instance is terminated, the modified local copy is lost. This introduces the concept of disposable instances. Instead of wasting lots of time dissecting how to fix a broken instance, all the need is to terminate the troubled instance and launch a new one. No matter how much damage is done to the running instance, the image started with will never be modified. Simple Storage Service (S3) One of the first services Amazon introduced was Simple Storage Service (S3), a distributed file storage system; it’s slow storage used to store any file-like objects or any data that is too large to store in a smaller system, this is typically provided for user by a network-attached-storage type of system supplied by user cloud hosting solution. Figure (2.7)shows the broken S3 into buckets and keys, with no sub-buckets or folders. Bucket names are globally unique across all
21
Figure (2.7) The S3 Hierarchy
They must also be Domain Name System (DNS) safe; that means that they cannot contain any characters other than lowercase characters, numbers, and dashes. This enables the access to bucket directly from the web with a hostname such as bucket-name. Buckets can be shared giving read and/or write access to other accounts and even could be made public. This complex access control system also enables access to be granted on the bucket or key level, so only a specific key can be shared if the whole bucket can not to be shared[4 ]. S3 is also the only AWS cloud service that comes with a service level agreement (SLA).This ensures that the service remains up at least 99.9% of the time. Amazon cloud also promises that no keys will be lost. Simple Data Base (SDB) One major problem with S3 is that it’s not designed for quick access and search ability. Amazon‘s reaction to this was to create a special type of database that is no relational and schema–less, known as SDB. It’s small, fast, and query able information. In most typical systems, this is handled by a database. There is no different in cloud–based applications, expect for how to host this database. SDB uses a simple hierarchy for storing metadata as is shown in figure (2.8). It can be used to fetch an item by its name or query on values by key name. It can 22
also be searched for patterns, sort, and compare lexicographically. It doesn’t support any types, so all values need to be stored in a lexicographical sort able string. Everything in SDB is automatically indexed, but it may take time before the items are added to the indexes. SDB also enables two different modes. In any system, either having consistency or high-availability. Originally, SDB only had a high-partitioning mode but has recently been updated to support a consistent mode for systems that need immediate reactions instead of perfect availability. This is handled by enabling to send a list of expected values on write, and request the most updated version of read or query [4 ].
Figure (2.8) The SDB hierarchy Simple Queue Service Simple Queue Service(SQS)is a central service used to store and receive messages .It can be used to send communications between processes asynchronously. Queues generally follow first–in-first–out (FIFO). Messages submitted to queues can be read by any AWS account that has grant to access. These messages are limited in size but, in general, can store enough information to trigger an event. They can be thought of as an asynchronous procedure call. Messages also have a built in method to handle errors. At the time the message is read from the queue, it’s hidden, or locked, from anyone else trying to read it for a set period of time. Also a message handled can be received and must be used to 23
delete the message, which can also be used to prolong the lock been acquired. This makes SQS the ideal system for processing tasks asynchronously [4 ].
2.12Building Web Application The typical web application uses three layers: presentation, application, and database. Figure (2.9) shows the three-tier web pattern[4], which is designed to help developer extrapolate the major parts of an application and enable it to be more modular and scalable. This architecture is designed to provide a public facing interface to an application as a whole. By splitting an application into multiple tiers.
Figure (2.9) The Three –Tier Web Pattern
2.12.1 The Presentation layer In this pattern, the presentation layer defines what the clients see on their system. The application has both the model and the control bits, and all logic actually happens in this layer. Directly under this presentation layer is the filter layer that enables developer to abstract the authentication and authorization from the application layer. It sits directly on top of application layer, modifying any input and output that flows through it. These two layers must both speak the same communication protocol. The presentation layer modifies any output from the application layer into a usable format. This typically transforms an internal representation, usually a raw object, into a standard such Extensible Markup Language( XML) is markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable [4 ]. 24
2.12.2 The Application Layer The application layer is where the user probably spend most of his time in programming it , because it is the heart and soul of any SaaS system; here is where the code translates into data and requests into actions, manipulating, changing, and returning data based on inputs from users or other systems. This layer is laid behind a proxy system that hides how many actual modules are in existence. Amazon enables the user to do this by providing a simple service known as Elastic Load Balancing (ELB) [ 4].
2.12.3 The Database Layer The database layer rests outside of primary servers. In some cloud platforms, this will actually be provided for developer automatically and developer not needs to control it. Database layers come in two main flavors: relational and non-relational. Typical relational data base layers include MySQL and Oracle. Some newer data bases, including SDB, are non-relational and do not support complex queries or joining to provide better scalability [4]. Figure (2.10) shows the traditional web application and its tiers, it’s similar to web application hosting in cloud in tiers with some difference in provisioning of services.
Figure (2.10) Traditional Web Application Architecture [15]
25
2.13 Benefits of Using AWS Over a Traditional Hosting Model If programmers are responsible for running a web application, they will face a variety of infrastructure and architectural issues, AWS can solve these issues by providing seamless and cost-effective solutions. The following are just some of the benefits of using AWS over a traditional hosting model:
2.13.1 A Cost-Effective Alternative to Oversized Fleets Needed to Handle Peaks In the traditional hosting model [15], servers need to be provisioned to process peak capacity, and unused cycles are wasted outside of peak periods. AWS-hosted web applications can cover on-demand provisioning of additional servers, so constantly adjust capacity and costs to actual traffic patterns occurs, figure (2.11) illustrates an example of wasted capacity in a classic hosting model.
Figure (2.11) Example of Wasted Capacity in a Classic Hosting Model
2.13.2 Scalable Solution to Handling Unexpected Traffic Peaks One of the main problems is the slow provisioning associated with a traditional hosting model and the inability to respond in time to unexpected traffic spikes. There are 26
many issues about web applications going down because of a sudden spike in traffic after the site is mentioned in the traditional media. The same on-demand capability that helps web applications scale to match regular traffic spikes can also process an unexpected load. New hosts can be launched and ready in a matter of minutes, and they can be taken offline just as rapidly when traffic returns to normal [15].
2.13.3 An On-Demand Solution for Test Some of expensive hardware is unused for long periods of time. In the AWS cloud, user can provision testing fleets only when he need them. Additionally, user can stimulate user traffic on the AWS cloud during load testing, he can also use the parallel fleets as a staging environment for a new production release, which allows quick switchover from current production to a new application version with little or no service outages [ 15].
27