Sunday, February 24, 2013

Difference between the XML and Database ?


Is XML and DATABASE are same ?

Can I use XML instead of DATABASE ?

Extensible Markup Language (XML) and databases are two different methods for storing large amounts of data in an organized fashion. There are both similarities and differences between them. Determining which to use depends on your needs and may actually be a combination of both

Difference between the XML and HTML

XML was designed to transport and store data.
HTML was designed to display data.

Understanding XML

  • XML is a standardized method of describing information, or data, established by the W3C. It is a tag based language, similar to HTML, but using stricter standards. Unlike HTML, tags are not predefined - they can be established based on the users needs at design time.

Understanding Databases

  • Databases are composed of collections of data organized into tables, with data stored in rows and columns. The columns define the type of data to be stored, such as a purchase date and customer IDs, and each row contains an instance of that data. Databases are often relational, which means that different data in multiple tables may be related by a key value. For example, a customer ID may be in the purchase table and a customer table, holding the customer information in the latter, and the specific information on the purchase in the former.

Similarities

  • XML and databases are similar in that they are both structured methods of organizing data. Each can contain a key value associated with one or more instances of data items. In XML, this would be multiple tags with the same name, such as <product>item1</product><product>item 2</product>. In a database, this is represented by a unique value of some type, for instance the customer order number, and one row of data for each product.

Differences

  • XML stores all of it's data in an XML file, which can be created and designed in a simple text editor. No special tools are required. A database application generally stores data in a specific data file, possibly reducing portability. In addition, databases are a specific application which requires some type of installation and a knowledge of structured query language (SQL) to access.
    Overall, while both are good storage solutions, the determination of which is best depends on the type of data to be stored. According to IBM's analysis of XML and databases, XML is most suited for "document-like storage" of data with a "semi-structured" format. Data which is heavily based on standard database design techniques, such as entity-relationship diagrams, is better suited for databases.

0 comments:

Post a Comment