Sistem Basis Data Lanjut - Official Site of Bertalya...

42
Sistem Basis Data Lanjut Sistem Manajemen Basis Data Web Tim Penyusun : Pengajar Universitas Gunadarma 2008

Transcript of Sistem Basis Data Lanjut - Official Site of Bertalya...

Sistem Basis Data Lanjut

Sistem ManajemenBasis Data Web

Tim Penyusun : Pengajar Universitas Gunadarma

2008

SMBD - Web 2

Sistem Basis Data Lanjut

Outline

• Web sebagai Platform AplikasiBasis Data

• Data semi terstruktur• Pengenalan XML• Bahasa Queri XML

SMBD - Web 3

Sistem Basis Data Lanjut

Internet

• Interconnected Networks– Kumpulan dari jaringan komputer

di seluruh dunia yg saling ter-hubung via TCP(TransmissionControl Protocol), IP(InternetProtocol)

– TCP bertanggungjawab menjaminpengiriman pesan dari satu komputerdgn yg lain, secara benar.

– IP mengelola pengiriman danpenerimaan paket data antara satumesin dgn yg lain.

SMBD - Web 4

Sistem Basis Data Lanjut

Sejarah Internet• Mulai dibangun pada thn 60an & 70an

oleh Departemen Pertahanan AS.– disebut ARPANET (Advanced

Research Projects Agency NETwork)– Poyek membangun jaringan yg dapat

menahan serangan secara fisik.

• 1982: TCP/IP diadopsi sebagai protocol standar untuk ARPANET

• 1986: proyek dipindahkan dari militer kepemerintahan/universitas dengan danaNational Science Foundation– Disebut NSFNET (National Science

Foundation NETwork)

• 1995: NSFNET mengakhiri pengontrolanbackbone jaringan; jaringan/network kemudian dikenal dengan Internet.

SMBD - Web 5

Sistem Basis Data Lanjut

Intranet & Extranet• Intranet : suatu web site atau

kumpulan web site dari suatuorganisasi, yg dapat diakses hanyaoleh anggota dari organisasitersebut (via firewall)

• Extranet : intranet yg dapat diaksessebagian oleh pengguna (diberiotoritas) di luar organisasi

SMBD - Web 6

Sistem Basis Data Lanjut

eCommerce & eBusiness• eCommerce

Pelanggan dapat menempatkan & membayar pesanan via web site

• eBusinessIntegrasi yg lengkap dari tehnologiinternet ke dalam infrastrukturekonomi bisnis

• EcosystemProses bisnis secara keseluruhandiotomatisi, dimana pemasok, alliance partners, corporate infrastructure merged into seamless system

SMBD - Web 7

Sistem Basis Data Lanjut

Web• Sistem berbasis hipermedia, yg

menyediakan ‘point and click’ berartibrowsing informasi pada internet menggunakan hyperlink

• Informasi pada halaman Web terdiriatas teks, grafik, gambar, & suara.

• Terdapat pula hyperlink ke halamanweb lainnya, dimana penggunadapat menelusuri dengan cara non-sekuensial melalui informasi.

• Dokumen2 web ditulis meng-gunakan HTML.

SMBD - Web 8

Sistem Basis Data Lanjut

Web (lanj.)• Web terdiri atas jaringan komputer

yg dpt berperan sebagai– Server, menyediakan informasi;

Contoh, Apache HTTP Server, Microsoft Internet Information Server, Netscape Enterprise Server, WebLogicServer & NCSA HTTPd

– Client (browsers), memohoninformasi.Contoh, Microsoft Internet Explorer, Netscape Navigator & NCSA Mosaic

SMBD - Web 9

Sistem Basis Data Lanjut

Web (lanj.)• Protocol yg mengatur pertukaran

informasi antara server & browser web adalah HTTP

• Lokasi dengan dokumen2 diiden-tifikasikan sebagai URL.

SMBD - Web 10

Sistem Basis Data Lanjut

Komponen Dasar Web

SMBD - Web 11

Sistem Basis Data Lanjut

HyperText Transfer Protocol(HTTP)

• Protokol yg digunakan untuk men-transfer halaman web melaluiinternet.

• Berbasis paradigma request-response :– Connection - Client berkoneksi dengan

Web server.– Request - Client mengirim permohonan

ke web server.– Response – web server mengirim

respon (dokumen HTML) pada client.– Close - Koneksi ditutup oleh web

server.

SMBD - Web 12

Sistem Basis Data Lanjut

MIME typesMultipurpose Internet Mail

Extensions

• Digunakan oleh HTTP header utkmenentukan penanganan tipemedia yg multipel

• Contoh:teks/html (dokumen html; *.html)aplikasi/java (java class file; *.class)

SMBD - Web 13

Sistem Basis Data Lanjut

HTTP RequestHTTP header mengindikasikan :1. Tipe permohonan

– GET: mendapat sumber yg diminta– POST: mentransfer data ke data yg

posted data pada sumber tertentu– HEAD: sama seperti GET tapi hanya

mengembalikan HTTP header– PUT (HTTP/1.1): upload sumber ke

server – DELETE (HTTP/1.1): menghapus

sumber dari server– OPTIONS (HTTP/1.1):memohon

pilihan konfigurasi server2. Nama sumber3. Versi HTTP 4. body (*optional)

SMBD - Web 14

Sistem Basis Data Lanjut

HTTP ResponseHTTP header mengindikasikan:

1. Versi HTTP2. Status respon3. Informasi utk mengontrol perilaku

respon4. body (*optional)

SMBD - Web 15

Sistem Basis Data Lanjut

HyperText Markup Language(HTML)

• Bahasa yg memformat dokumendigunakan utk merancang halamanweb.

• Bahasa yg sederhana, punyakekuatan, bahasa dokumen yg tidakbergantung pada platform tertentu.

• HTML merupakan aplikasi dariStandardized Generalized Markup Language (SGML), sistem ygmendefinisikan tipe dokumen ygterstruktur & markup language utkmerepresentasikan instance2 daritipe2 dokumen tsb.

SMBD - Web 16

Sistem Basis Data Lanjut

Contoh File HTML

SMBD - Web 17

Sistem Basis Data Lanjut

Contoh Halaman HTML

SMBD - Web 18

Sistem Basis Data Lanjut

Uniform Resource Locators(URLs)

• URL terdiri atas 3 bagian: – protokol yg digunakan utk

koneksi– Nama host – Nama path pada host dimana

sumber disimpan. • Can optionally specify:

– port through which connection to host should be made,

– query string.

http://www.w3.org/Markup/MarkUp.html

SMBD - Web 19

Sistem Basis Data Lanjut

Kebutuhan Untuk IntegrasiWeb-DBMS

• Kemampuan utk mengakses data yg berharga dengan cara yg aman.

• Konektivitas data & vendor yg tidakbergantung sehingga terdapatkebebasan untuk memilih DBMS.

• Ability to interface to database independent of any proprietary browser or Web server.

• Connectivity solution that takes advantage of all the features of an organization’s DBMS.

SMBD - Web 20

Sistem Basis Data Lanjut

• Open architecture to allow interoperability with a variety of systems and technologies. For example: – different Web servers; – Microsoft's (Distributed) Common Object

Model (DCOM/COM);– CORBA/IIOP (Internet Inter-ORB protocol);– Java/Remote Method Invocation (RMI).

• Cost-effective solution that allows for scalability, growth, and changes in strategic directions, and helps reduce applications development costs.

SMBD - Web 21

Sistem Basis Data Lanjut

ArsitekturTwo-Tier Client-Server

SMBD - Web 22

Sistem Basis Data Lanjut

ArsitekturThree-Tier Client-Server

• Client side presented two problems preventing true scalability:– ‘Fat’ client, requiring considerable

resources on client’s computer to run effectively.

– Significant client side administration overhead.

• By 1995, three layers proposed, each potentially running on a different platform.

SMBD - Web 23

Sistem Basis Data Lanjut

SMBD - Web 24

Sistem Basis Data Lanjut

• Advantages: – ‘Thin’ client, requiring less

expensive hardware.– Application maintenance

centralized. – Easier to modify or replace one

tier without affecting others. – Separating business logic from

database functions makes it easier to implement load balancing.

– Maps quite naturally to Web environment.

SMBD - Web 25

Sistem Basis Data Lanjut

Advantages of Web-DBMS Approach

Web sebagai platform sistem basis data

• DBMS advantages• Simplicity• Platform independence• Graphical User Interface• Standardization• Cross-platform support• Transparent network access• Scalable deployment

• Innovation

SMBD - Web 26

Sistem Basis Data Lanjut

Disadvantages of Web-DBMS Approach

• Reliability• Security• Cost• Scalability• Limited functionality of HTML• Statelessness• Bandwidth• Performance• Immaturity of development tools

SMBD - Web 27

Sistem Basis Data Lanjut

Pendekatan2 UntukMengintegrasikan Web &

SMBD

• Scripting Languages. • Common Gateway Interface (CGI).• HTTP Cookies.• Extending the Web Server.• Java, JDBC, SQLJ, Servlets, and

JSP.• Microsoft Web Solution Platform:

ASP and ADO.• Oracle Internet Platform.

SMBD - Web 28

Sistem Basis Data Lanjut

Scripting Languages (JavaScript and VBScript)

• Scripting languages can be used to extend browser and Web server with database functionality.

• As script code is embedded in HTML, it is downloaded every time page is accessed.

• Updating browser is simply a matter of changing Web document on server.

• Some popular scripting languages are: JavaScript, VBScript, Perl, and PHP.

• They are interpreted languages, not compiled, making it easy to create small applications.

SMBD - Web 29

Sistem Basis Data Lanjut

Common Gateway Interface (CGI)

• Specification for transferring information between a Web server and a CGI program.

• Server only intelligent enough to send documents and to tell browser what kind of document it is.

• But server also knows how to launch other programs.

• When server sees that URL points to a program (script), it executes script and sends back script’s output to browser as if it were a file.

SMBD - Web 30

Sistem Basis Data Lanjut

CGI - Environment

SMBD - Web 31

Sistem Basis Data Lanjut

• CGI defines how scripts communicate with Web servers.

• A CGI script is any script designed to accept and return data that conforms to the CGI specification.

• Before server launches script, prepares number of environment variables representing current state of the server, who is requesting the information, and so on.

• Script picks this up and reads STDIN.

SMBD - Web 32

Sistem Basis Data Lanjut

• Then performs necessary processing and writes its output to STDOUT.

• Script responsible for sending MIME header, which allows browser to differentiate between components.

• CGI scripts can be written in almost any language, provided it supports reading and writing of an operating system’s environment variables.

SMBD - Web 33

Sistem Basis Data Lanjut

SMBD - Web 34

Sistem Basis Data Lanjut

• CGI is the de facto standard for interfacing Web servers with external applications.

• Possibly most commonly used method for interfacing Web applications to data sources.

• Advantages:– simplicity, – language independence, – Web server independence, – wide acceptance.

SMBD - Web 35

Sistem Basis Data Lanjut

Keuntungan CGI• Communication between client

and database server must always go through Web server.

• Lack of efficiency and transaction support, and difficulty validating user input inherited from statelessness of HTTP protocol.

• HTTP never intended for long exchanges or interactivity.

• Server has to generate a new process or thread for each CGI script.

• Security.

SMBD - Web 36

Sistem Basis Data Lanjut

HTTP Cookies• Cookies can make CGI scripts more

interactive. • Cookies are small text files stored on

Web client. • CGI script creates cookie and has Web

server send it to client’s browser to store on hard disk.

• Later, when client revisits Web site and uses a CGI script that requests this cookie, client’s browser sends information stored in the cookie.

• Cookies can be used to store registration information or preferences (e.g. for virtual shopping cart).

• However, not all browsers support cookies.

SMBD - Web 37

Sistem Basis Data Lanjut

Integrasi SMBD & Web

SMBD - Web 38

Sistem Basis Data Lanjut

SMBD - Web 39

Sistem Basis Data Lanjut

SMBD - Web 40

Sistem Basis Data Lanjut

SMBD - Web 41

Sistem Basis Data Lanjut

SMBD - Web 42

Sistem Basis Data Lanjut

Referensi

1. Korth, H.; Database System Concept, Mc Graw Hill, 4th edition, New York, 2002