55
ATI – Arsitektur Aplikasi Web [email protected]

ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

  • Upload
    lamtram

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

ATI – Arsitektur Aplikasi Web

[email protected]

Page 2: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Internet & Web BasicsInternet & Web Basics

Page 3: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Internet

• What is Internet?

– A world-wide network of computer networks

• Internet is huge client server system

Page 4: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Internet vs. WWW

Internet is the infrastructure

that makes the WWW work.

• Packet Switching

• TCP/IP Protocol

• Physical Infrastructure

WWW is just one of many

“virtual networks” built on

the Internet.

• Websites: http, https, etc.

• Email: pop, imap, etc.• Physical Infrastructure

– Fiber-optics lines, wires

– Satellites, Cable Modems

– Routers, Hubs, Network

Cards, WiFi systems, etc.

• Email: pop, imap, etc.

• Other systems: ftp, instant

messaging, etc.

Page 5: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web

• Tim Berners-Lee at CERN proposed the Web in 1989

– Purpose: to allow scientists to have access to many databases of scientific work through their own computers

• From document (linier media) to hypertext (hyper • From document (linier media) to hypertext (hyper media)

– Ex of Linier media is a book, pages, document, cassete• We’ll call them documents

– Hypermedia – media that provide point to the need• Examples: CD, DVD, Webpages

• Web provides Hyperlink

Page 6: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Protokol Web: HTTP

• Hypertext Transport Protocol (RFC 1945)– Oleh Tim Berners-Lee, 1990

• Protocol that used to communicate between web browsers and web servers

• Using TCP port 80 (default)• Using TCP port 80 (default)

• This protocol supports hypermedia files

• HTTP 1.0 becomes 1.1 by IETF (RFC 2616)

Page 7: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Session

• When client and server communicate, their

connection has to be maintenance…

• HTTP provides session

• A basic HTTP session has four phases:• A basic HTTP session has four phases:

– Client opens the connection

– Client makes the request

– Server sends a response

– Server closes the connection

Page 8: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Stateless

• But HTTP is “stateless”

– HTTP is a stateless protocol, which means that once a server has delivered the requested data to a client, the connection is broken, and the server retains no memory broken, and the server retains no memory of what has just taken place

• No information that retain

• Solution? Cookies & Session

Page 9: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP (2)

• HTTP is request – response:

– HTTP client (user agent) request s to HTTP server and Server will response

• The basic different of HTTP/1.1 and HTTP/1.0 is theirpersistent connectionpersistent connection

• HTTP/1.0 is not using persistent connection

– Header = Connection: close

• HTTP/1.1 is using persistent connection

– Header = Connection: Keep-Alive

– But client can set header manually (header = Connection: close).

Page 10: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Connection

Page 11: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Message

Page 12: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Request

• A request consists of:

– Initial line

– Headers

– Blank line– Blank line

– Message body

Page 13: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Request Example

GET /courses/ati/index.html HTTP/1.1 From: [email protected] User-Agent: Firefox User-Agent: Firefox [blank line here] Method Path Version

Headers

Initial line

Page 14: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Request Methods

• GET - Fetch a document

– Ex: URL variabel

• POST - Execute the document, using the data in bodydocument

– Ex: form submit– Ex: form submit

• HEAD - Fetch just the header of the document

– Ex: date modified

• PUT - Store a new document on the server

– Ex: upload using WebDAV

• DELETE - Remove a document from the server

Page 15: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP Response status

Page 16: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google
Page 17: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

HTTP/1.1 200 OK Date: Fri, 31 Dec 2013 23:59:59 GMT Content-Type: text/html Content-Length: 1354

Response ExampleInitial line

Version

Status code

<html> <body> <h1>Hello World</h1> (more file contents) . . . </body> </html>

Headers

Reason phrase

Message body

Page 18: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Server

• Software that accepts requests from clients (browsers, telnets) and then response that requests back to clients

• Example: Apache, Nginx, Xitami, Internet • Example: Apache, Nginx, Xitami, Internet Information Services

• Using port to listen to (default:80)

• Using other configuration files

• Usually integrated with server scripting programming languages (PHP, ASP, JSP, etc)

Page 19: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Server basic capabilities

• Virtual hosting: multiple domain

• Address mapping: map request address to the

actual file on server

• Authentication: by password, host credentials• Authentication: by password, host credentials

• Handling MIME (multi purpose internet mail

extensions)

• Caching support

• Security support

Page 20: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Mapping URL pada Web Server

Page 21: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Server Software

• The most popular Web server programs are:

– Apache HTTP Server

– Microsoft Internet Information Server (IIS)

• According to Netcraft

– Accumulates popularity rankings

Page 22: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Server Environment Variables

Page 23: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Browsers

• All browsers are clients

• Mosaic - NCSA (Univ. of Illinois), in early 1993

– First to use a GUI, led to explosion of Web use

– Initially for X-Windows, under UNIX, but was – Initially for X-Windows, under UNIX, but was ported to other platforms by late 1993

• Most requests are for existing documents, using HTTP

– But some requests are for program execution, with the output being returned as a document

Page 24: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

The Logos

Page 25: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web TierWeb Tier

Page 26: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Architecture

• Layering Aspect

– “Separation of concerns”

– How many concurrent users are you serving?

– Shared needs among multiple applications?

• Data Aspect• Data Aspect

– What kind(s) of data are you delivering?• Structured vs non structured

• On-demand vs. real-time

– What are the bandwidth requirements?• Size & nature of data

• audience concerns

Page 27: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

1-tier Architecture

Very easy way!

Page 28: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

2-Tier Architecture

BrowserYour code to generate HTML,process forms, generate SQL

queries on database

Any browser

Application

MySQL

queries on database

Apache

PHP

Application

Open-source: free, fast,and dependable

Windows, Linux, Solaris, etc

WAMP: Windows, Apache, MySQL, PHP.

Page 29: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

3-tier web architectures

Client

Presentation

HTML rendering

Templates, HTML generationscripts, XML and XSLT

Application-specific componentsBusiness Logic

Data Access

Data

Application-specific componentsand application logic

Domain-specific anddatabase-independent layer,

typically object-oriented

Data storage, typicallyan (SQL) RDBMS

Page 30: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

The Tiers

• Presentation Layer

Static or dynamically generated content rendered by the browser (front-end)

• Logic Layer

A dynamic content processing and generation level A dynamic content processing and generation level application server, e.g: Java EE, ASP.NET, PHP, ColdFusion platform

• Data Layer

A database, comprising both data sets and the database management system or RDBMS software that manages and provides access to the data (back-end)

Page 31: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Integration ProblemWeb Integration Problem

Page 32: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Connecting to Legacy Systems

Using middleware components

Web ServerWeb Server MAINFRAMEMAINFRAME

WebApp

LegacyApp

MiddlewareCORBA, RMI

Page 33: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Connecting to Legacy Systems

The “screen scraper”

Terminalscreen data

Screen Existing

HTML data

HTMLdata

Legacy system(mainframe)

Client Web server Legacy database

Screen scraper

Existing application

Page 34: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Connecting to Legacy Systems

The “web sevices”

SOAP/REST

Web Existing

HTML data

XMLdata

Legacy system(mainframe)

Client Web server Legacy database

Service Client

Existing application

Web Service Server

Page 35: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Application ArchitectureWeb Application Architecture

Page 36: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Server side

• Server hardware

• Web servers software

• Apache, Xitami, IIS, GlassFish

• Server side programming language

• PHP, JSP, ASP, ASP.NET, Ruby on Rails, Python, • PHP, JSP, ASP, ASP.NET, Ruby on Rails, Python, Perl, Cold Fusion

• MIME configuration• Utility Programming Tools:

• Database Server

• MySQL, SQLServer, Oracle

Page 37: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Client side

• Client hardware• Web browsers

• MIME config

• Language: HTML / XML / XHTML• Client side scripting: Javascript / VBScript• Design: CSS• Design: CSS• Interactive software:

• Flash player

• Java Applet

• Client software:• ActiveX / Plugin: program yg terintegrasi dgn browser

• Helper: program yg terinstall di client

Page 38: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Arsitektur Aplikasi Web Konvensional

Arsitektur Konvensional

Page 39: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Client-Server Web Detail

Page 40: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Arsitektur Aplikasi Web SekarangTren Sekarang (Ajax-Based)

Page 41: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web Data Aspect architectureWeb Data Aspect architecture

Page 42: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

• Structured data of the kind held in database

• Documents of the kind used in document

management systems

• Multimedia data of kind held in media servers

Data aspect architecture

• Multimedia data of kind held in media servers

and multimedia management systems

Page 43: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

• Integrate DB into Web app

• DB are accessed either directly from within

Web server extension, such as:

– JDBC

Database centric architecture

– JDBC

– ODBC

– ADO

– ADO.NET

Page 44: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

• Document management systems

– Integrate documents from different sources

Architecture of Document

Management Systems

Ex: Alfresco Document Management Systemswww.alfresco.comwww.alfresco.com

Page 45: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

DMS Capabilities

Page 46: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

• Streaming

– Client can begin play out of

audio few second after it

begins receiving the file from

server

– Corresponding bandwidth,

low jitter

Architecture of multimedia data

low jitter

– Real time protocol

• Example:

– Application Helix Media

Server

– Web: Youtube

Page 47: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web ApplicationWeb Application

Page 48: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Web App

Case Study : Yahoo! Directory

Provider-defined directory

4848

Page 49: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

• Facebook

– More than 200 million active users

– MS paid $240 million for 1.6 percent

Web App

Case Study : Facebook

Activities of your friends

Your current status

photos

Friends

49

Comment, Rate

Chat

Aggregationwith Picasa

Video

groupsMore apps!

Page 50: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Google Web Applications

• Google Docs

• Google Search Engine

• Google Blog (Blogspot)

• Google Books

• Google Play (Android)

• Google Translate

• Google Scholar

• Google Video (YouTube)Google Video (YouTube)

• Google AdSense, AdWord

• Google Calendar

• Google Groups

• Google Earth

• Google Map

• Google Drive

• Google Hangout

• Google+

• Picasa

• Go.gl

• Google Analytics

Page 51: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Examples of two “versions” of web

apps

1995-2005 Web 2005-Present Web

Britannica Online Wikipedia

Akamai BitTorrent

Directories TaggingDirectories(Taxonomy)

Tagging(Folksonomy)

Tightly coupled apps App Mashup/Integration

Home page Blog

Page 52: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

OpenSocial

• A coherent open architecture designed for social network services and applications.

– Common APIs across many websites

• REST/RPC protocols – for server-to-server interactions

• Javascript APIs – for browser-to-server interactions• Javascript APIs – for browser-to-server interactions

– Authorization mechanism, Data model …

• Usage

– Supported by MySpace, Google Orkut, Twitter, LinkedIn, XiaoNei…

• Internationalization

– Rival: Facebook

Page 53: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

OpenSocial – Architecture exampleComponents• Interface –

REST, Javascript APIs

• Client – Ajax, Gadget

• Message Format –JSON, XML

• Security - OAuth

• Data Model

Logic level

Page 54: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Authentication – OpenID• Motivation

– Provide lightweight authentication service across domains

• SolutionUsers are asked to prove ownership of their OpenID identifiers.

– OpenID identifiers are URLs

– Authentication delegation (service provider → identity provider)

• Advantages– Cross-domain authentication– Cross-domain authentication

– Attribute exchange beyond authentication

– Single Sign-On

– Easy OpenID provider switch

• Drawbacks– Phishing attack

• Resources– Supported by Facebook, Verisign, Sourceforge, Yahoo, etc.

Page 55: ATI –Arsitektur Aplikasi Web - lecturer.ukdw.ac.idlecturer.ukdw.ac.id/anton/download/ati3.pdf · Google Web Applications ... • Google Scholar • Google Video (YouTube) • Google

Next

• Service Oriented Architectures