Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm currently working on a project that uses a Webserver running in Windows CE 6.0. Since this server only supports classic ASP (i.e, no PHP, ASP.NET, etc.)/ I plan to use XML as the database.

Is this the best approach, or there is an easier way to do this, taking in consideration that I'm used to work in C and not high level languages?

share|improve this question
5  
"Best" is undefined. What do you mean by "best"? Fastest? Cheapest? Simplest? Most use of Oracle licensed technology? "Best" can mean almost anything. You should provide your objectives so we know what "best" means in your specific case. –  S.Lott Sep 20 '11 at 17:04
    
There are vastly better options for embedded platforms in 2011, why are you crippling yourself with winCE? –  Wyatt Barnett Sep 20 '11 at 17:09
2  
Binary formats are always better than XML. XML is there to simplify exchange over unknown channels, but from performance standpoint it's a lot worse than binary database. –  Coder Sep 20 '11 at 17:12
    
@WyattBarnett: In my experience, these decisions are not usually the developer's first choice, but are there to meet some obscure or special requirement. –  FrustratedWithFormsDesigner Sep 20 '11 at 17:16
    
@WyattBarnett In fact I'd really prefer to work in another platform, however is not really my choice :s –  Jamiro14 Sep 21 '11 at 8:52
add comment

closed as unclear what you're asking by gnat, BЈовић, Kilian Foth, MichaelT, World Engineer Jul 29 '13 at 14:02

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 1 down vote accepted

I think XML is just fine if your database isn't going to scale much. Though there are some points you might consider :

  1. XML has no indexing mechanism, if you want to search by several criteria or join different data you can't.
  2. XML data is mainly plain text, it can be tampered with easier than a database.
  3. XML does not provide aggregate functions like SQL - So you will need to code aggregate functions, etc.
  4. XML has no concurrency management, you work with a file not a row.
  5. User security and user rights need to be secured - This is usually handled via database or Windows integrated security.
  6. Most report generators require a data source that is either CSV or a database (of course you can build a datatable or similar using XML and pass that to the report generator as an object, this depends on your selected tool).
  7. Databases offer simple and generally quick backup.
  8. You can add/remove columns from database with relative ease.
  9. Database offer consistency checks and constraints as well as transcriptional processing allowing you to rollback in case of errors.
  10. Databases offer stored procedure that allows you to encapsulation server logic within them
  11. Using a database, you can allow your user to enter dynamic sql queries instead of programming every possible report.
share|improve this answer
    
I've read your answer and I think none of the disadvantages of XML you've listed will make a difference in this project. Thank you. –  Jamiro14 Sep 21 '11 at 9:25
add comment

Have you looked into SQLite? It is an embedded SQL database engine with pretty good performance, and it gives you the power of SQL (there are some advanced features it doesn't have, check their website for details), which might make it easier and faster to access your data than reading and processing DOM objects. I believe it's also written in C so integration shouldn't be a serious problem.

share|improve this answer
    
Is it easy to learn and use taking in consideration that my database won't be complex or large? –  Jamiro14 Sep 21 '11 at 9:18
1  
would you mind explaining more on what it does and why do you recommend it as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Jul 28 '13 at 7:53
1  
@gnat: You're right, I've added a bit more detail. –  FrustratedWithFormsDesigner Jul 29 '13 at 15:41
add comment

XML is a text based file format, which is no more a database than a CSV file or any other text based file format.

Your question is like asking asking if JPEG makes for a good image editor. JPEG is a file format just like XML is a structured file format, neither provide any executable functionality.

Use a real database, there are plenty of suitable embedded databases that offer real database functionality. SQLite or BerkleyDB make for good alteratives in a constrained embedded model based on C.

share|improve this answer
    
-1 for the JPEG example. XML can (reasonably successfully) be used as a storage format, and drivers exist to use CSV and XML as backends. –  insta Sep 20 '11 at 20:30
    
XML is just that a storage format, but is isn't a database, no where near it. No more than a JPEG image is an executable. –  Jarrod Roberson Sep 20 '11 at 20:48
    
You make my point exactly, XML is just a file format. –  Jarrod Roberson Sep 20 '11 at 20:54
    
@JarrodRoberson: You're right, but you're only pointing out the OPs misuse/abuse of the term database. That's not very constructive and since Mark's edit, your answer no longer makes sense in context. –  Steve Evers Sep 20 '11 at 20:57
    
XML is not a database, that is true, but neither is that a very good analogy. XML can be used as a storage format to accomplish the same goals as a database, whereas you can't use a JPEG instead of an image editor. –  jhocking Sep 20 '11 at 21:10
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.