Skip to main content

XML is Not a Database

XML is good- but only for some things. XML is very good at describing ordered lists, documents like they will be printed on paper, and simple trees, like family trees. For other things, XML is really bad. All other computer data with a more abstract nature has trouble conforming efficiently to the tree hierarchy of XML. Programs which use XML to describe and retrieve all kinds of data indiscriminately, suffer intense processing delays- particularly while attempting to traverse an ordered list to retrieve unordered data.

The strongest feature of XML is that it's very close to the ubiquitous HTML. It's easy for many people to learn about XML because they're used to HTML. Data described by XML can be transformed into HTML very easily.

XML works great to describe lists of items, like feeds of syndicated content for things like a news feed, stock quotes, or a series of audio or video episodes. It's great at describing outlines, with bigger sections broken down into smaller and smaller sections. It describes forms of data entry like control panels (buttons, sliders, and switches,) and parts of forms (like text entries, check boxes, and selections from a list of multiple choices.) Really it's pretty good for describing visual documents for direct human consumption, as they'll be printed on paper or displayed statically on a flat screen.

But it's for "documents," not for "data!" This is important because the data in XML documents will always be in a specific order. If it's about books, the books will either be listed by title, or by author. If you want to look up a book in the document, by title, when they're listed by author, you'll have to traverse all the authors looking at every title- unless you create some additional artificial layer cross-indexing the document. Easy you say- make two lists in the file that work both ways. But when you have a million books and also need the ability to search by ISBN, publisher, and copyright date, how efficient will that be? :-)

Don't panic. There's a solution which has been invented. Actually, this invention took place many years ago, and has been proved solid to many people through intensive usage. Have you ever heard of the Relational Database? Unlike the XML document, the Relational Database has been specifically designed to store and retrieve every type of data, for every usage imaginable. And it's super efficient, too. I hope you know SQL.


Popular posts from this blog

How (Not) to Handle Different Exceptions

Came across this sample from a certain multi-billion-dollar company, purporting to show how to implement exception handling. I slightly changed a few cosmetic details to make it anonymous.
try { // ... } catch (GeneralException e) { if (e instanceof SpecificExceptionA){ // ... } else if (e instanceof SpecificExceptionB){ // ... } }This is a true actual story--you can't make this stuff up. Yeah, I thought it was pretty hilarious; so I felt like I had to share it.

What We're About

About UsMission Statement: We provide a product to make high performing software developers happy by giving them a chance to work in a more self-directed way on software that is more meaningful to them. Core Values (in priority order):Integrity: Honesty, trustworthiness, and faithfulnessPreparation: Research, planning, and goalsReputation: Branding, naming, presence, and networkingProfitability: Product salesProduction: Product development, ideas, online contentImprovement: Research and trainingSupport: Minimal overhead Who We Are
Isaac Serafino is a Software Architect in Omaha, Nebraska. He has a strong experience developing technology solutions. He has long had the dream to lead his own startup business.
Our ProductsSnap Screen™
More efficiently provide a safe environment for using electronic devices. Sends pictures of what is on the display at somewhat random times so user knows they could be observed at any time, but the supervisor does not need to be their watching over their sho…