Sistem Basis Data Lanjut
Sistem Manajemen Basis Data Web
Tim Penyusun : Pengajar Universitas Gunadarma 2008
Sistem Basis Data Lanjut
Outline • Web sebagai Platform Aplikasi Basis Data • Data semi terstruktur • Pengenalan XML • Bahasa Queri XML
SMBD - Web
2
Sistem Basis Data Lanjut
Internet • Interconnected Networks – Kumpulan dari jaringan komputer di seluruh dunia yg saling terhubung via TCP(Transmission Control Protocol), IP(Internet Protocol) – TCP bertanggungjawab menjamin pengiriman pesan dari satu komputer dgn yg lain, secara benar. – IP mengelola pengiriman dan penerimaan paket data antara satu mesin dgn yg lain.
SMBD - Web
3
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 ke pemerintahan/universitas dengan dana National Science Foundation – Disebut NSFNET (National Science Foundation NETwork) • 1995: NSFNET mengakhiri pengontrolan backbone jaringan; jaringan/network kemudian dikenal dengan Internet. SMBD - Web
4
Sistem Basis Data Lanjut
Intranet & Extranet • Intranet : suatu web site atau kumpulan web site dari suatu organisasi, yg dapat diakses hanya oleh anggota dari organisasi tersebut (via firewall) • Extranet : intranet yg dapat diakses sebagian oleh pengguna (diberi otoritas) di luar organisasi
SMBD - Web
5
Sistem Basis Data Lanjut
eCommerce & eBusiness • eCommerce Pelanggan dapat menempatkan & membayar pesanan via web site • eBusiness Integrasi yg lengkap dari tehnologi internet ke dalam infrastruktur ekonomi bisnis • Ecosystem Proses bisnis secara keseluruhan diotomatisi, dimana pemasok, alliance partners, corporate infrastructure merged into seamless system SMBD - Web
6
Sistem Basis Data Lanjut
Web • Sistem berbasis hipermedia, yg menyediakan ‘point and click’ berarti browsing informasi pada internet menggunakan hyperlink • Informasi pada halaman Web terdiri atas teks, grafik, gambar, & suara. • Terdapat pula hyperlink ke halaman web lainnya, dimana pengguna dapat menelusuri dengan cara nonsekuensial melalui informasi. • Dokumen2 web ditulis menggunakan HTML.
SMBD - Web
7
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, WebLogic Server & NCSA HTTPd
– Client (browsers), informasi.
memohon
Contoh, Microsoft Internet Explorer, Netscape Navigator & NCSA Mosaic
SMBD - Web
8
Sistem Basis Data Lanjut
Web (lanj.) • Protocol yg mengatur pertukaran informasi antara server & browser web adalah HTTP • Lokasi dengan dokumen2 diidentifikasikan sebagai URL.
SMBD - Web
9
Sistem Basis Data Lanjut
Komponen Dasar Web
SMBD - Web
10
Sistem Basis Data Lanjut
HyperText Transfer Protocol (HTTP) • Protokol yg digunakan untuk mentransfer halaman web melalui internet. • Berbasis paradigma requestresponse : – 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
11
Sistem Basis Data Lanjut
MIME types Multipurpose Internet Mail Extensions • Digunakan oleh HTTP header utk menentukan penanganan tipe media yg multipel • Contoh: teks/html (dokumen html; *.html) aplikasi/java (java class file; *.class)
SMBD - Web
12
Sistem Basis Data Lanjut
HTTP Request HTTP 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 server
2. Nama sumber 3. Versi HTTP 4. body (*optional) SMBD - Web
13
Sistem Basis Data Lanjut
HTTP Response HTTP header mengindikasikan: 1. Versi HTTP 2. Status respon 3. Informasi utk mengontrol perilaku respon 4. body (*optional)
SMBD - Web
14
Sistem Basis Data Lanjut
HyperText Markup Language (HTML) • Bahasa yg memformat dokumen digunakan utk merancang halaman web. • Bahasa yg sederhana, punya kekuatan, bahasa dokumen yg tidak bergantung pada platform tertentu. • HTML merupakan aplikasi dari Standardized Generalized Markup Language (SGML), sistem yg mendefinisikan tipe dokumen yg terstruktur & markup language utk merepresentasikan instance2 dari tipe2 dokumen tsb. SMBD - Web
15
Sistem Basis Data Lanjut
Contoh File HTML
SMBD - Web
16
Sistem Basis Data Lanjut
Contoh Halaman HTML
SMBD - Web
17
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.h tml SMBD - Web
18
Sistem Basis Data Lanjut
Kebutuhan Untuk Integrasi Web-DBMS • Kemampuan utk mengakses data yg berharga dengan cara yg aman. • Konektivitas data & vendor yg tidak bergantung sehingga terdapat kebebasan 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
19
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
20
Sistem Basis Data Lanjut
Arsitektur Two-Tier Client-Server
SMBD - Web
21
Sistem Basis Data Lanjut
Arsitektur Three-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
22
Sistem Basis Data Lanjut
SMBD - Web
23
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
24
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
25
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
26
Sistem Basis Data Lanjut
Pendekatan2 Untuk Mengintegrasikan 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
27
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
28
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
29
Sistem Basis Data Lanjut
CGI - Environment
SMBD - Web
30
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
31
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
32
Sistem Basis Data Lanjut
SMBD - Web
33
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
34
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
35
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
36
Sistem Basis Data Lanjut
Integrasi SMBD & Web
SMBD - Web
37
Sistem Basis Data Lanjut
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
Referensi 1.
Korth, H.; Database System Concept, Mc Graw Hill, 4th edition, New York, 2002
SMBD - Web
42