May 19, 2008 1:30 p.m. 2:30 p.m. Platform: Linux, UNIX, Windows Session: H03 Database Driven Web 2.0 for the Enterprise Rav Ahuja IBM
Agenda What is Web 2.0 Web 2.0 in the Enterprise Web 2.0 Examples and Demos AJAX REST Web Services Feeds Mashups Summary 2
What is Web 2.0 A set of technologies and applications that enable efficient interaction among people, content, and data in support of collectively fostering new businesses, technology offerings, and social structures Forrester O Reilly: Web 1.0 Web 2.0 Britannica Online Wikipedia personal websites blogging screen scraping web services publishing participation directories tagging stickiness syndication 3
Web 2.0 Web 2.0 is about being an active contributor, not a passive observer Network as a Platform Gets better the more people use it Rich User Experiences architecture of participation Tim O Reilly 4
Web 2.0 Examples Wikis Wikipedia (http://www.wikipedia.org/ ) Blogs Blogger (http://www.blogger.com/ ) Tagging Flickr (http://www.flickr.com/ ) Digg (http://digg.com/) Mashups www.housingmaps.com QEDwiki 5
Web 2.0 what does it mean to me? technology Radical Simplification Mash-ups HTTP ATOM PHP REST AJAX JSON RSS Networking Wikis Blogs People Behavior Harnessing Collective Intelligence sociology 6
Web 2.0 Enablers AJAX Asynchronous Javascript and XML: A mechanism to update parts of a web-page without refreshing the entire page Wiki A group of Web pages that facilitates community authoring AdSense A mechanism that helps creators of web sites serve up advertisements relevant to a site s content Blog A web-based publication of periodic articles (a.k.a. weblog) RSS Really Simple Syndication: a family of XML file formats for web syndication, which provides a way to distribute information Mash-up A mash-up is a composite application derived by aggregating components or services Tagging Bookmarks providing a way to attach keywords to pages or images on the web helping categorize and making it easier to find (i.e., metadata) REST Representative State Transfer: an architectural style for distributed hypermedia systems like the world wide web 7
Web 2.0 in the Enterprise Internal and External facing Corporate Communications and Messaging Executive Blogs Content Delivery via RSS Lowering Support costs Self-service and collaborative documentation through wikis Dynamic Applications sans lengthy IT projects Exposing locked-up data using REST services Empowering LOB using Mashups 8
Web 2.0 as an extension of a SOA 9
Info 2.0 Making data more accessible Social Search & Tagging Collaboration Social Media Sharing Situational Applications Blogs & Wikis Mashups Social Networking Info 2.0 Information Services to create Web 2.0 applications Internet Feeds Enterprise Feeds Departmental Feeds 10
Web 2.0 for Information Management Information mashup technologies for business Simple Empowering tech savvy business users Information Driven Value centered on business information Re-mixable New opportunity to combine information Collaborative Open APIs for building an ecosystem of software providers and customers Rich Experience More compelling Internet applications lead to improved user loyalty User Generated Content Active participation & self organization to influence application development 11
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication Mashups 12
What is XML? XML = extensible Markup Language Simplicity Self describing Adaptive Interoperable Standards based <book> <authors> <author id= 47 >John Doe</author> <author id= 58 >Peter Pan</author> </authors> <title>database systems</title> <price>29</price> <keywords> <keyword>sql</keyword> <keyword>relational</keyword> </keywords> </book> 13
DB2 9: purexml and Relational Capabilities Relational and XML data are stored differently, but closely linked SQL to manipulate relational data SQL/XML to publish relational data as XML XQuery or SQL/XML to query XML data Join Relational and XML data DB2 9 SERVER CLIENT DB2 Client / Client Application SQL/XML XQuery Relational Interface XML Interface Hybrid DB2 Engine DB2 Storage: Relational XML 14
DB2 9 and XML XML data is stored in XML-typed columns in tables create table dept (deptid char(8),, deptdoc xml); XML is stored in a parsed hierarchical format deptid PR27 deptdoc <dept> <emp> </emp> </dept> Relational columns are stored in relational format DB2 Storage 15
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication (RSS and Atom) Mashups 16
PHP Extensive PHP support in DB2 IBM supported PHP drivers/extensions PHP Data Objects: PDO_DB2 Native extension for DB2 (ibm_db2) Concentrating on API common stack for PHP, PDO, abstraction layers, etc., Via DB2 CLI Driver (aka CLI Thin Client) All IBM PHP drivers are offered under open-source licenses and are available at http://www.php.net and http://www.pecl.php.net Zend core for IBM released in partnership with Zend 17
PHP Demo IBM Software Group 18
RUBY on Rails with DB2 Native DB2 RUBY driver supported by IBM Rails adaptor (active record based) supported by IBM Built on top of DB2 CLI for optimum performance Starter Toolkit for DB2 on Rails One-click installer for pre-tested, reconfigured installation of Ruby, Rails & DB2 Express-C Check it out @ www.db2onrails.com 19
RoR Demo IBM Software Group 20
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication Mashups 21
AJAX Asynchronous JavaScript Allows Partial refreshes of web content possible Information can be pushed to user Rich set of user interface controls Useful for building Rich Internet Applications A web-based application that makes use of advanced UI capabilities and transfers some of the processing to the client. HTML Data Data User uses the web page! XML 22
AJAX allows asynchronous calls Building the DOM AJAX Calls Web Server Web Client Using AJAX, multiple asynchronous calls can be made to multiple datasources This data composes the DOM creating a mashup of information presented to the user as a single experience DB2 9 23
Dojo Toolkit IBM Software Group The Dojo toolkit is a modular open source DHTML library written in JavaScript designed to ease the rapid development of JavaScript-based applications in a number of environments. Dual-licensed, and may be obtained under the terms of either the BSD License or the Academic Free License. http://dojotoolkit.org/ Provides a framework for creating AJAX applications 24
Web 2.0 Example using Dojo and DB2 9 25
Ajax Demo IBM Software Group 26
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication Mashups 27
Web Services Web Service: A repeatable business task e.g. get product price and description, validate address, get temperature, check customer credit, open new account, etc. Allow interaction between services on any platform, written in any language Types of Web Services SOAP more commonly used in Enterprise and SOA environments REST more prevalent in Web 2.0 Both based on XML 28
REST Web Services REST allows us to assign a unique address (URL) to a resource We can then retrieve this resource using HTTP www.mycompany.com/products/kitchen The URL returns an XML representation of the kitchen products sold by mycompany Easily expose data in DB2 9 as a web service Can return XML data using either SQL/XML or XQuery Easily call other web services from DB2 9 Can directly store the XML returned by Web services 29
REST Demos 30
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication Mashups 31
Feeds and Blogs Feeds From Wikipedia: A web feed is a data format used for serving users frequently updated content. Content distributors syndicate a web feed, thereby allowing users to subscribe to it. Making a collection of web feeds accessible in one spot is known as aggregation. Most common XML formats are ATOM and RSS syndication Feeds can be based on Blogs 32
Feeds and DB2 Syndication is heartbeat of Web 2.0 RSS/ATOM Feeds encapsulated as XML Use XML database for serving and strong feeds E.g. Stock ticker feeds, inventory feeds, etc. Web Server Web Server ATOM/RSS Reader DB2 9 ATOM/RSS Provider 33
Demo of DB2 Serving ATOM Feed Show we can take a given XML document and produce a feed: This demo includes have pre-built some stored procedures to help us simplify XML to ATOM. We can pre-define feeds which can be served directly from the database via most Web technologies: PHP,.NET, WebSphere or Ruby 34
Key Web 2.0 Technologies XML Open Source Scripting AJAX Web Services Feeds and Syndication Mashups 35
What is a Mash-Up? From WikiPedia: A mashup is a website or web application that seamlessly combines content from more than one source into an integrated experience. How are they created? Typically APIs are sourced from Information Source Demos of QEDWiki which builds mash-up with DB2 9 can be found on the following URL: Tiny url needed : https://cc.callinfo.com/cc/playback/playback.do?id=w0i7d1cn 36
Mashup Demo 37
Summary Web 2.0 merger technology and social networking Enterprises leveraging Web 2.0 for a variety of benefits Easily enable data driven Web 2.0 with DB2: Use purexml to lay the foundation for Web 2.0 projects Build rich web applications with DB2 e.g. AJAX, PHP, Ruby on Rails Expose DB2 data as services or consume data form other services Expose data as feeds or store feeds in DB2 Mashup data in DB2 with other data sources It is good and it is easy. Let s go do it! 38
Session H03 Session: Database Driven Web 2.0 for the Enterprise Rav Ahuja IBM rsahuja@ca.ibm.com 39