What is XML and how is it used in databases? If this looks like a homework assignment, it is.
Databases are often used to store blocks of XML for applications which do not want to serialise it out to an actual database schema. But generally speaking, XML is not used in databases.
This is imply because databases are about storing data where as XML is really about transmitting it in an agnostic manner.
(Simplified) Usually what happens is application A converts data from database A into an XML stream which is transmitted to application B. Application B then converts the XML into a series of SQL statements which create records in database B.
There are lots of other scenarios, but this gives you a general idea.
Xml (Extensible Markup Language) is a mark-up language for encoding documents in a machine-readable format, with emphasis on flexibility, simplicity and usability over the internet.
Its main advantages over other encodings are interoperability - many programming environments have the ability to read and parse xml, and it has the advantage of being human readable. For this reason xml is commonly used when transporting or communicating data (such as on the internet).
The Wikipedia page on xml has a lot more specific information, however some examples of various uses of xml are:
Conversely, xml's verbosity and flexible structure comes at the cost of being relatively expensive to read (in terms of computational power) and so xml is not generally used as a storage encoding in performance oriented applications (such as databases).
In terms of how xml would be used in databases - a database might choose to expose data to its client in an xml format or accept data from the client in an xml format. Databases might also be used to store "Blobs" of xml data as records in a table, however this comes at the cost of it being difficult to query the database based on the content of that xml.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With