Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases 11
Computer Science 202 Computer Science 202
Databases in Electronic Databases in Electronic
Commerce Commerce
2 2 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Objectives Objectives
To learn the definition for e
To learn the definition for e- -commerce, and its commerce, and its importance in the current business environment.
importance in the current business environment.
To learn some of the benefits and the disadvantages of To learn some of the benefits and the disadvantages of e
e- -commerce, as it currently exists. commerce, as it currently exists.
To learn the major security and privacy issues that relate To learn the major security and privacy issues that relate to e
to e- -commerce. commerce.
To learn how payments for purchases are handled in e To learn how payments for purchases are handled in e- - commerce.
commerce.
To learn the requirements for e
To learn the requirements for e- -commerce databases. commerce databases.
To learn the definition of XML and its importance in e To learn the definition of XML and its importance in e- - commerce.
commerce.
To learn how DTD and XSD documents fit into the e To learn how DTD and XSD documents fit into the e- - commerce environment.
commerce environment.
3 3 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
What is E
What is E- -commerce ? commerce ?
Definition Definition
n
n
Bring new products, services, or ideas to Bring new products, services, or ideas to market
market
n
n
Support and enhance business operations Support and enhance business operations (including sales of products/services over the (including sales of products/services over the Web)
Web)
Generally identified with Internet use Generally identified with Internet use External evidence is corporate Web site External evidence is corporate Web site Prime revenue source
Prime revenue source
4 4 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -Commerce Issues Commerce Issues
Changed business environment Changed business environment New economy
New economy Benefits Benefits Disadvantages Disadvantages
5 5 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -Commerce Benefits Commerce Benefits
Ability to provide quick and convenient Ability to provide quick and convenient comparison shopping
comparison shopping 24X7X365 operations 24X7X365 operations Global access Global access Lower entry barriers Lower entry barriers
Increased customer market knowledge Increased customer market knowledge Customer Profiling
Customer Profiling
6 6 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -Commerce Disadvantages Commerce Disadvantages
Hidden costs Hidden costs
Technology is not perfect Technology is not perfect Thin profit margins Thin profit margins Security
Security
loss of privacy
loss of privacy
service levels
service levels
legal issues
legal issues
7 7 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -Commerce Models Commerce Models
Business to Business (B2B) Business to Business (B2B)
n
n
Interactions on a much higher level Interactions on a much higher level
n
n
Business interacting with Suppliers Business interacting with Suppliers
n
n
Business interacting with Distributors Business interacting with Distributors Business to Consumer (B2C) Business to Consumer (B2C)
n
n
Mass Market Mass Market
n
n
Amazon, Kalahari.net, Barnes&Noble Amazon, Kalahari.net, Barnes&Noble Intra Business
Intra Business
n
n
Electronic activities within a company Electronic activities within a company
n
n
Often between divisions or employees and Often between divisions or employees and organisation
organisation
8 8 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -Commerce Models Commerce Models
9 9 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Architecture Architecture
Managerial issues Managerial issues
n
n
Establishing partnerships Establishing partnerships Suppliers
Suppliers Distributors Distributors Vendors Vendors
n
n
Design and development of business plans Design and development of business plans Technological issues
Technological issues
n
n
Hardware and software Hardware and software
n
n
Well Well- -planned architecture planned architecture
10 10 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Basic Network Services Basic Network Services
11 11 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Basic Network Services Basic Network Services
12 12 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Business Logic/Functions
Business Logic/Functions
13 13 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -commerce Services commerce Services
14 14 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Overall E
Overall E- -Commerce Architecture Commerce Architecture
15 15 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
E
E- -commerce Systems commerce Systems
16 16 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Security Security
Procedures and technology uses Procedures and technology uses
n
n
Protection against accidental and intentional access Protection against accidental and intentional access
n
n
Warrantee identity of transaction’s participants Warrantee identity of transaction’s participants Buyer
Buyer Seller Seller
n
n
Protect transaction data from unauthorized Protect transaction data from unauthorized modifications during Internet travel modifications during Internet travel
n
n
Protect resources (data and computer) Protect resources (data and computer) Customers’ personal data
Customers’ personal data Privacy issues Privacy issues
Property against criminal activities Property against criminal activities
17 17 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Transaction Processing Transaction Processing
Digital Cash Digital Cash
n
n
Digital equivalent of hard cash Digital equivalent of hard cash
n
n
Digital certificates verify identity of transaction Digital certificates verify identity of transaction participants
participants
n
n
Low transaction costs Low transaction costs
n
n
Lack of customer acceptance Lack of customer acceptance Credit Card purchasing Credit Card purchasing
n
n
Most common for online purchasing Most common for online purchasing
n
n
Secure Electronic Transaction (SET) Secure Electronic Transaction (SET) Electronic wallets
Electronic wallets
18 18 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Database Design for E
Database Design for E- -Commerce Commerce
Don’t reinvent the wheel Don’t reinvent the wheel
New application but uses the same design New application but uses the same design techniques
techniques E
E- -Commerce DB should provide Commerce DB should provide
n
n
Facilitate sales of products and services Facilitate sales of products and services
n
n
Show products and services Show products and services
n
n
Conduct basic sales transactions Conduct basic sales transactions
n
n
Customer service Customer service
n
n
Product returns Product returns
n
n
Web customer profiling Web customer profiling
19 19 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Basic Logic Basic Logic
Sell products Sell products
n
n
PRODUCT and CUSTOMER Tables PRODUCT and CUSTOMER Tables Customer may place multiple orders Customer may place multiple orders
n
n
1:M relationship between CUSTOMER and ORDER 1:M relationship between CUSTOMER and ORDER Order contains multiple lines
Order contains multiple lines
n
n
1:M relationship between ORDER and ORDLINE 1:M relationship between ORDER and ORDLINE Order lines refer to one product
Order lines refer to one product
n
n
1:M between PRODUCT and ORDLINE 1:M between PRODUCT and ORDLINE
20 20 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Business Logic Business Logic
Customer browses catalog by category Customer browses catalog by category
n
n
Each PRODUCT belongs to PRODTYPE Each PRODUCT belongs to PRODTYPE Customer places products in shopping cart Customer places products in shopping cart
n
n
SHOPCART belongs to one CUSTOMER and SHOPCART belongs to one CUSTOMER and references one or more PRODUCTS references one or more PRODUCTS
Customer checks out and enters credit card and Customer checks out and enters credit card and shipping info
shipping info
n
n
Added to ORDER Added to ORDER
After credit card authorization order created After credit card authorization order created
n
n
SHOPCARD used to create ORDER with ORDLINEs SHOPCARD used to create ORDER with ORDLINEs
21 21 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Business Logic Business Logic
Merchant offers shipping options Merchant offers shipping options
n
n
SHIPOPTION stores details SHIPOPTION stores details
Merchant offers many payment options Merchant offers many payment options
n
n
PMTOPTION stores details PMTOPTION stores details
States may have different tax rates States may have different tax rates
n
n
Stored in STATE and TAXRATE Stored in STATE and TAXRATE
22 22 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
eXtensible Markup Language eXtensible Markup Language - -XML XML
Meta
Meta- -language language
Represents and manipulates data Represents and manipulates data elements
elements
Facilitates exchange of structured Facilitates exchange of structured documents over the Web
documents over the Web
World Wide Web Consortium (W3C) World Wide Web Consortium (W3C) published standard
published standard Allows definition of meta
Allows definition of meta- -tags to describe tags to describe data elements
data elements
23 23 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML Breakdown XML Breakdown
Allows definition of new tags Allows definition of new tags Case sensitive
Case sensitive
n
n
Tags must be well Tags must be well- -formed formed
n
n
Proper nesting required Proper nesting required Can use <
Can use <-- -- and and -- --> to enter comments > to enter comments XML/xml prefixes reserved for XML tags XML/xml prefixes reserved for XML tags only
only
Not a replacement for HTML Not a replacement for HTML
24 24 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML example
XML example
25 25 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
The XML DTD The XML DTD
File with .dtd extension to describe XML File with .dtd extension to describe XML elements
elements
Provides composition of database’s logical Provides composition of database’s logical model
model
Defines syntax rules for each XML Defines syntax rules for each XML document
document Defines valid tags Defines valid tags
26 26 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML DTD Example XML DTD Example
27 27 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
DTD Application DTD Application
28 28 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML Schema XML Schema
Advanced data definition language used to Advanced data definition language used to describe structure of XML documents describe structure of XML documents Checks for database types
Checks for database types Validates data for out
Validates data for out - -of of- -range values range values XML Schema Definition (XSD) file uses XML Schema Definition (XSD) file uses syntax like XML document
syntax like XML document
29 29 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
Formatting XML Formatting XML
Specifies rules for display of XML data Specifies rules for display of XML data Two parts
Two parts
n
n
Extensible Style Language Transformation (XSLT) Extensible Style Language Transformation (XSLT) General mechanism to extract and process data from one General mechanism to extract and process data from one XML document and transform within another
XML document and transform within another
n
n
XSL style sheets XSL style sheets
Defines presentation rules applied to XML elements Defines presentation rules applied to XML elements Describes formatting options for different XML elements Describes formatting options for different XML elements
Limited browser support Limited browser support
30 30 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML Schema Example
XML Schema Example
31 31 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XSLT Application Example XSLT Application Example
32 32 Barry Irwin August 2003
Barry Irwin August 2003 Rhodes University CS202 DatabasesRhodes University CS202 Databases
XML Applications XML Applications
B2B exchanges B2B exchanges
Legacy system integration Legacy system integration Web page development Web page development Database support Database support Database meta
Database meta - -dictionaries dictionaries XML databases
XML databases
XML services ( ‘Web services’)