Web-Database Integration
For E-commerce
What We Will Cover
E-commerce and Databases
What is e-commerce?
Exchanging value electronically
(e.g. money for products)
What are typical features of e-commerce site?
- Shop and order online
- Browse and search catalogs
- Track order fulfillment
- Receive personalized information
- Register and track users
- Manage inventory
- Create user communities
Which of these involves using a database?
back to top
Technologies Behind E-commerce
E-commerce requires two key technologies: one old and one new
Databases
- Relational databases devised by Dr. E. F. Dodd in 1970
- Most businesses need databases to be competitive
World-Wide Web (WWW)
- Before the WWW, it was difficult to access databases
- Since the mid-1990's, almost every computer user can access the WWW
- Businesses can reach almost anyone in world to offer products and services
back to top
Advantages of Web-Database Integration
- Reduced development costs
- Key is separating content from presentation
- Store information in database or access existing databases
- Create templates to display different categories of information
- Generate web pages automatically using templates and data from database
- More efficient than creating individual web pages and links 'by hand'
- Web site maintenance greatly reduced
- Web pages updated dynamically by changing information in database
- Changing information in database takes less time and skill
- Enhanced web interactivity with personalized information
back to top
E-commerce Architecture
- E-commerce architectures usually consists of three or more tiers
- Multi-tiered approach allows various application to run on different devices
Client Tier
- Browser runs on client machine
- Clients may exist inside or outside firewalls
- Can run applets or applications on client machine
Middle Tier
- Web server responds to user requests with HTML pages
- HTML pages generated from static files or created dynamically by application software
- More applications being connected to servers to provide more services
(email, chat, remote login, file transfer, money-transfer, e-commerce)
- Applications sometimes reside on different machines than Web server
- Everything connected by networks
- Middleware is software that mediates between applications and network
Database Tier
- Databases can run on same machine as Web server or on separate machine
- Many databases connect through their own server
back to top
Writing Web Applications
- E-commerce sites consist of collection of application programs
- Two main approaches to writing web applications
- Standalone application
- Can create anything computationally possible
- Takes a long time to write or change programs
- Use web-application frameworks
- Collection of generic components providing solutions to number of related problems
- Usually provide scripting languages for interaction between components
- A scripting language is usually:
- Application frameworks often differentiated by their scripting environments
back to top
Web-Application Frameworks/Scripting Environments
Common-Gateway Interface (CGI)
- One of the oldest standards for running external programs on a web server
- Can use any programming language supported by server
- CGI is generally slow because new process created with every call
Active Server Pages (ASP)
- One of the best-known and best-supported web scripting technologies
- Over 1M developers and 35M web pages
- Shipped with most Windows products
- Multi-platform support via Sun's Chilli!Soft product
- Can run many scripting languages including Perl
- Test server speed of 43 pages per second
PHP Hypertext Protocol (PHP)
- Open source and works on multiple platforms
- Code is like a mixture of Java, C++ and Perl
- Test server speed of 47 pages per second
Java Server Pages (JSP)
- Part of J2EE framework
- Both open source and commercial versions available
- Embedded Java within HTML pages
- Test server speed of 13 pages per second (Beta 5)
- Probably much faster now with HotSpot JVM
ColdFusion
- In zdnetindia article, rated top choice overall
- Easiest programming language and best administration
- Test server speed of 29 pages per second
For more information
zdnetindia.com: Four scripting languages tried and tested. (circa October 2000)
FAQ's: See the FAQ on this topic.
Links: See the links comparing server-side technologies.
back to top
Comparing Server-side Scripting Languages
Comparison as of 8/15/01
* Free on Windows servers, $495 on other servers using Chilli!Soft
** Professional Edition v.5 $1295,
Enterprise Edition v.5 $4995,
UltraDev Studio v.4.5 $599 (Client only)
back to top
Database Management Systems
- Databases store and manage large collections of information
- Database Management System (DBMS) used to manage databases
- Contains programs to control organization, storage and retrieval of data
- Accepts requests for data and instructs operating system to transfer appropriate data
- Provides security mechanisms to prevent unauthorized users from viewing or updating data
- Maintains integrity by not allowing more than one user to update same record at same time
- Provides mechanisms to interactively enter, update and interrogate data
- Many provide their own Database Server
back to top
Popular DBMS's for Web Sites
- Many DBMS's available to create databases
- Microsoft Access: quite useable for creating low-transaction databases. 100+ simultaneous users if implemented carefully
- Microsoft SQL Server: useful for creating high-transaction databases for busy eCommerce sites
- Oracle: most popular for large organizations due to its extensive capabilities. Can download Oracle9i free for non-commercial use.
- MySQL: becoming popular due to speed, compactness and low cost. Available free under GPL or by low-cost commercial license.
- PostgreSQL: another open source database system
- Scripting languages can access all these databases -- and more
back to top
How Scripting Languages Interface With Databases
- Web-application frameworks provide methods to connect to databases
- Most use ODBC, but some provide direct interfaces to specific databases
- ODBC (Open DataBase Connectivity) is open standard for accessing databases using SQL
- SQL (Structured Query Language) is industry-standard language for creating, updating and querying relational DBMS's
- Most DBMS's support ODBC and SQL
- ASP uses ActiveX Data Objects (ADO) and OLE-DB to connect to databases
- ADO is an easy-to-use wrapper for Microsoft's OLE-DB
- OLE-DB is a high-performance, low-level interface to data stores of all kinds
- One of the OLE-DB interfaces connects to ODBC
- Using ADO, ASP can easily access any database with an ODBC driver
- PHP contains modules for connecting to databases and conducting SQL queries
- JSP and Java use Java DataBase Connectivity (JDBC)
- Defines application programming interface (API) for Java
- Uses standard SQL access to databases
back to top
Check Your Understanding
- How can databases make Web sites more dynamic?
- What is the purpose of the middle-tier of the e-commerce architecture?
- Why would a database have its own server?
- What are some of the services that a Database Management System (DBMS) provides to the database?
- What does the Open Database Connectivity (ODBC) standard provide?
- What is Structured Query Language (SQL) used for?
back to top