Cloud Computing Platform as a Service

Similar documents
GAE Google App Engine

Google App Engine: Java Technology In The Cloud

Seminar report Google App Engine Submitted in partial fulfillment of the requirement for the award of degree Of CSE

Platform as a Service lecture 2

Google GCP-Solution Architects Exam

Development of web applications using Google Technology

Developing Solutions for Google Cloud Platform (CPD200) Course Agenda

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved

Building Scalable Web Apps with Python and Google Cloud Platform. Dan Sanderson, April 2015

Getting the most out of Spring and App Engine!!

SSC - Web applications and development Introduction and Java Servlet (I)

INTRODUCTION TO SERVLETS AND WEB CONTAINERS. Actions in Accord with All the Laws of Nature

Java Enterprise Edition

Advanced Internet Technology Lab # 4 Servlets

Active Endpoints. ActiveVOS Platform Architecture Active Endpoints

Platform as a Service (PaaS)

Western Michigan University

Servlets by Example. Joe Howse 7 June 2011

Developing with Google App Engine

Java Enterprise Edition. Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 1

ICOM 5016 Database Systems. Database Users. User Interfaces and Tools. Chapter 8: Application Design and Development.

Implementation Architecture

JAVA SERVLET. Server-side Programming INTRODUCTION

Developing Applications with Java EE 6 on WebLogic Server 12c

WWW Architecture I. Software Architecture VO/KU ( / ) Roman Kern. KTI, TU Graz

Session 9. Introduction to Servlets. Lecture Objectives

The Basic Web Server CGI. CGI: Illustration. Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems 4

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Page 1

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests

Real Life Web Development. Joseph Paul Cohen

Servlet Fudamentals. Celsina Bignoli


Cloud Computing. Chapter 3 Platform as a Service (PaaS)

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

MySQL & NoSQL: The Best of Both Worlds

Implementation Architecture

sessionx Desarrollo de Aplicaciones en Red A few more words about CGI CGI Servlet & JSP José Rafael Rojano Cáceres

Advanced Topics in Operating Systems. Manual for Lab Practices. Enterprise JavaBeans

Performance Evaluation of J2EE(2)

Let s say that hosting a cloudbased application is like car ownership

Session 8. Introduction to Servlets. Semester Project

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

Introduction to Servlets. After which you will doget it

Ch04 JavaServer Pages (JSP)

1Z Oracle. Java Enterprise Edition 5 Enterprise Architect Certified Master

Developing a Mobile Web-based Application with Oracle9i Lite Web-to-Go

INTRODUCTION TO GOOGLE APP ENGINE

Open Source Library Developer & IT Pro

STARCOUNTER. Technical Overview

Large-Scale Web Applications

Web based Applications, Tomcat and Servlets - Lab 3 -

Web Applications. Software Engineering 2017 Alessio Gambi - Saarland University

BEAWebLogic. Portal. Overview

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

CIT 668: System Architecture. Amazon Web Services

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Servlets1. What are Servlets? Where are they? Their job. Servlet container. Only Http?

Lab session Google Application Engine - GAE. Navid Nikaein

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

3. The pool should be added now. You can start Weblogic server and see if there s any error message.

Windows Azure Mobile Services

1Z Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions

Middle East Technical University. Jeren AKHOUNDI ( ) Ipek Deniz Demirtel ( ) Derya Nur Ulus ( ) CENG553 Database Management Systems

Servlets and JSP (Java Server Pages)

Standards and the Portals Project

Groovy and Grails in Google App Engine

Build Meeting Room Management Website Using BaaS Framework : Usergrid

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M

Copyright 2014 Blue Net Corporation. All rights reserved

AWS Lambda: Event-driven Code in the Cloud

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

Lab 10. Google App Engine. Tomas Lampo. November 11, 2010

AJP. CHAPTER 5: SERVLET -20 marks

COURSE 9 DESIGN PATTERNS

Java SE7 Fundamentals

Vlad Vinogradsky

Enterprise Java Technologies (Part 1 of 3) Component Architecture. Overview of Java EE. Java Servlets

Google Plugin for Eclipse

SECURE, FLEXIBLE ON-PREMISE STORAGE WITH EMC SYNCPLICITY AND EMC ISILON

Developing Enterprise Cloud Solutions with Azure

Google App Engine HOWTO

X-S Framework Leveraging XML on Servlet Technology

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Session 20 Data Sharing Session 20 Data Sharing & Cookies

The Gearman Cookbook OSCON Eric Day Senior Software Rackspace

/ Cloud Computing. Recitation 10 March 22nd, 2016

Realtime visitor analysis with Couchbase and Elasticsearch

CloudI Integration Framework. Chicago Erlang User Group May 27, 2015

IBM WebSphere Application Server V4.0. Performance. 10/02/01 Copyright 2001 IBM Corporation WS40ST11.prz Page 248 of of 28

Intro to Couchbase Server for ColdFusion - Clustered NoSQL and Caching at its Finest

20486-Developing ASP.NET MVC 4 Web Applications

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Front End Programming

Storage Made Easy Enterprise File Share and Sync Fabric Architecture

NoSQL & Firebase. SWE 432, Fall Web Application Development

Java Servlets. Preparing your System

Introduction to JPA. Fabio Falcinelli

CS506 Web Design & Development Final Term Solved MCQs with Reference

Transcription:

HES-SO Master of Science in Engineering Cloud Computing Platform as a Service Academic year 2015/16

Platform as a Service Professional operation of an IT infrastructure Traditional deployment Server Storage Network OS Patch DB App Server Config App App Tiers START FINISH Infrastructure as a Service 20% time savings Infrastructure START OS Patch DB App Server Config App App Tiers FINISH Platform as a Service Platform App App Tiers 80% Time Savings START FINISH 2

Platform as a Service Some offers Services Open Source software 3

Platform as a Service Reminder: Web applications in Java Servlets A servlet runs inside an application server The server calls the servlet to handle an HTTP request The task of the servlet is to create the response HTTP request Application server Servlet Browser HTTP response Servlet Database Servlet 4

Platform as a Service Reminder: Web applications in Java Servlets Complete picture of the processing of an HTTP request Browser Application servier Servlet Database HTTP request URL HTTPServlet Request object query data HTTPServlet Response object HTTP response HTML HTML 5

Platform as a Service Reminder: Web applications in Java Servlets Example implementation of a servlet package com.example; import java.io.ioexception; import java.io.printwriter; import javax.servlet.servletexception; import javax.servlet.http.*; @SuppressWarnings("serial") public class SampleServlet extends HttpServlet { } @Override protected void doget(httpservletrequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setcontenttype("text/plain"); PrintWriter pw = resp.getwriter(); pw.println("hello, world"); } 6

Introduction Google App Engine is a service for hosting web applications. Designed in particular for dynamic real-time applications. Makes it easy to deploy a web application. The client (developer) supplies the application s program code. Google s platform is responsible for running it on its servers. There are some restrictions regarding the supported application types. The application cannot access everything on the server. The application must limit its processing time. Launched in April 2008 (preview) In production since September 2011 Supported programming languages: Python Java Go PHP 7

Important properties Automatic scaling Able to support a large number of users. Resources are added automatically. The application does not need to specify in advance how much resources it will need. Like any other cloud service: Pay as you go On-demand self-service Conceptually App Engine can be divided into three pieces: Application instances Data storage service Scalable complementary services 8

Architecture Request handlers Services HTTP HTTP Front ends Application servers Datastore Blobstore Browser HTTP Static file servers Memcache deploy app configure URL fetch Mail Images XMPP App master Channel Task queue 9

Programming model Java The client/developer writes servlets. App Engine implements the Java Servlet Specification. The platform offers data storage services. Accessible via a direct API or an ORM like Java Data Objects (JDO) or Java Persistence API (JPA). The developer can use web application frameworks. Java Server Pages (JSP) Java Server Faces (JSF) Google Web Toolkit (GWT) Spring MVC Play... The platform offers other APIs for Asynchronous tasks Caching Notifications Image processing... In principle the developer can use other languages that compile to Java Virtual Machine byte code, like Scala Ruby (JRuby)... 10

Request Handler abstraction A Request Handler is an abstraction: it is a piece of code responsible for creating a response to an HTTP request. In the case of Java it s a servlet. A Request Handler has a life cycle: (1) A request arrives. (2) The Request Handler is created. It receives the request. (3) The Request Handler creates the response. To do this it can use the App Engine services and the storage. (4) When the response has been sent App Engine is free to remove the Request Handler from memory. The Request Handler is stateless. Source: Dan Sanderson, Programming Google App Engine, O'Reilly 11 request request 1 2 Services and storage 3 4 Request Handler Services and storage response request Request Handler Services and storage Services and storage response

Request Handler abstraction When the number of requests increases App Engine allocates additional Request Handlers. All Request Handlers process the requests in parallel. Request Handler Request Handler Request Handler Services and storage 12

Request Handler and Instance abstractions But where does a Request Handler live? Inside an instance! Server 1 Instance Server 2 Instance Server 3 Instance Local memory Local memory Local memory request Request Handler response request Request Handler response Services and storage 13

Request Handler and Instance abstractions The abstraction of a Request Handler may be satisfying, but instantiating and destroying a program for each request would not make sense in practice. The initialization of a program is expensive. Especially the initialization of local memory. Instances are containers in which the Request Handlers live. An instance keeps the initialized local memory that will be reused for subsequent requests. At any point in time an application has a certain number of instances allocated to process requests. The front-end distributes the requests among the available instances. If necessary App Engine allocates new instances. If an instance is not used during a certain time interval (idle), App Engine frees the instance. request Server 1 Instance Local memory Request Handler response Services and storage 14

Request Handler and Instance abstractions Instances are visible in the console 15

Request Handler and Instance abstractions Active instances are billed to the client by instance hours. The client is able to change the parameters of the instance allocation algorithm in the console. 16

Isolation of different applications: the sandbox App Engine cannot work with any Java application. App Engine needs to distribute HTTP requests to several servers. A server may run several applications. Applications written by different App Engine clients must not interfere between one another. Compared to a generic Java application server applications run in a more restricted environment: the sandbox. An application is not able to Write to the file system. Use the Datastore. Open a socket or access another host directly. Use the URL fetch service. Respond slowly (the application has to respond in a few seconds). Use the Task Queue service. Make other system calls. An application is able to 17 Use a subset of the Java standard library: JRE Class White List Use threads. However threads must not live longer than the request. Read the file system. Use reflection. Use customized classloaders.

Data storage services App Engine offers mainly three services for data storage: App Engine Datastore: Persistent data storage in a NoSQL database Google Cloud SQL: A relational database based on MySQL Google Cloud Storage: Persistent object (= file) storage Additionally the application is able to use caching of database requests by using the following service Memcache: An in-memory data caching service 18

The Datastore The Datastore is a data storage service. It is not a database dedicated to one client. It is a gigantic scalable database that contains the data from all clients. Multi-tenant model Runs on a cluster of servers (distributed architecture). Behind the scenes the service manages the distribution and replication of data and load balancing of database queries automatically. The application calls simply an API, without caring where the data is stored; without caring about the capacity of the database: virtually unlimited. The data model is different from the relational (SQL) model. No need to declare a schema before writing data. Aggregate-oriented data model. Transaction guarantees are different from SQL databases. Relaxed consistency guarantees 19

The Datastore Data model The data model of the Datastore is organized along three major concepts: Entity: An object in the Datastore containing several properties. Each object has a unique key. Kind: The "type" of an entity, for example an e-commerce application would have the kinds client, article, order. Used in queries to find the stored entities. Does not imply the presence of properties. Property: A property contains one piece of data of an entity, for example customer name, article price. An entity may have several properties. Each property has a name and at least one value. 20

The Datastore Data example Entity Property "title" "The Grapes of Wrath" Key bookstore "Book" 837094 "author" "copyrightyear" "John Steinbeck" 1939 Application ID Kind Entity ID Ancestor path "authorbirthdate" 1902-02-27 Name Value 21

The Datastore Entity key The keys of the entities in the datastore have to be unique even across App Engine clients. A key is composed of several parts The application identifier Ensures that there are never collisions with keys from other applications. Is automatically managed by App Engine. Cannot be modified by the application. The entity kind Contributes to the uniqueness of the key. Is used by the Datastore in queries The entity identifier. This part may be specified by the application. In this case this part is called key name. automatically generated by the Datastore. In this case this part is called ID. (Optional) The ancestor path: a path composed of the entity's ancestors Allows to locate the entity in a hierarchical structure. NB: When the key of an entity has been created it can no longer be changed! 22

The Datastore Corresponding terms Approximative correspondence of terms used in object-oriented programming, relational databases and the Datastore. Be careful, the concepts are not equivalent! Object-oriented Relational Datastore Class Table Kind Object Row Entity Attribute Column Property 23

The Datastore Low-level API //... import com.google.appengine.api.datastore.datastoreservice; import com.google.appengine.api.datastore.datastoreservicefactory; import com.google.appengine.api.datastore.entity; //... DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); Entity book = new Entity("Book"); book.setproperty("title", "The Grapes of Wrath"); book.setproperty("author", "John Steinbeck"); book.setproperty("copyrightyear", 1939); Date authorbirthdate = new GregorianCalendar(1902, Calendar.FEBRUARY, 27).getTime(); book.setproperty("authorbirthdate", authorbirthdate); ds.put(book); //... 24

The Datastore High-level API Java Persistence API (JPA) A class that we want to store in the Datastore: The code that will store this class: import java.util.date; import javax.persistence.entity; import javax.persistence.id; @Entity(name = "Book") public class Book { @Id private String isbn; } private String title; private String author; private int copyrightyear; private Date authorbirthdate; //... constructors, accessors import myapp.book; // our data class //... EntityManager em = null; try { em = emf.createentitymanager(); Book book = new Book(); book.settitle("the Grapes of Wrath"); //... em.persist(book); } finally { if (em!= null) em.close(); } 25

Quotas Like any other cloud service, Google bills clients for the resources they use, But the allocation of resources is automatic as a function of user demand. The client does not have direct control. With resource allocation that is principally unpredictable costs would be unpredictable as well. Google adopted a billing model that is similar to prepaid contracts for mobile networks. The client fixes a budget at the beginning. When the budget is exhausted the service stops functioning. Quota model: At the beginning of each day (midnight Pacific time) maxima are fixed for the usage of resources during the next 24 hours: the quotas. If usage remains below the quota, everything is fine. When usage exceeds the quota, the service is suspended. Service resumes the next day. Users may receive HTTP error 500. A call to a service by the application may raise an exception. There are also per-minute quotas to limit explosive resource usage. 26

Free usage Google offers a free usage of App Engine. In this case the daily quotas are the ones listed on the right. By paying a client is able to increase the quotas. Quota Instance hours Data transf. inbound Data transf. outbound Datastore storage Datastore operations Google Cloud Storage Email API URLFetch API XMPP API Channel API... Limit (per day) 28 hours 1 GB 1 GB 1 GB (total, not per day) 50k 5 GB 100 emails 657k calls 10k stanzas 100 channels open 27

Other services URL Fetch service Access content of web pages on other sites. Call services of other sites via HTTP. Email service Send and receive email messages. XMPP service Send and receive instant messages using the XMPP protocol. Memcache service Accelerate reading of objects stored in a storage service by copying them into a cache in memory. Blobstore service Store objects that are too big for the other storage services. Task Queue service Execute background tasks by putting them into a queue. Allows to circumvent the time limitation of Request Handlers Scheduled Task service Execute background tasks at a specific time. Users service Authenticate users via several different mechanisms. Images service Manipulate images (e.g., create thumbnails) Channel service... Push information in real-time to the JavaScript program running in the browser. 28

Logging For debugging and monitoring an application developers are encouraged to use the java.util.logger library. Log messages are saved by App Engine. The developer can look them up in the console, or download them to the local machine. The standard output (System.out) and error (System.err) streams are also captured and saved by App Engine. Appear in the logs as INFO / WARNING messages. 29