|
-
February 21st, 2007, 11:05 AM
#1
XML or Database?
I want to create a small data table in one of my programs for HighScore. I was wondering if to use XML or to create a database. Does someone who worked with both XML & Databases can tell me what way is better and what way is faster?
Also, Ill be happy to know what to use and when.
Thanks for time, Tal.
-
February 21st, 2007, 11:21 AM
#2
Re: XML or Database?
For small data amounts of data I would use XML. If you want to store large amounts of data a database is the better choice. Additional another point of view is how do you want to access the data. If you want to access from one application you can use XML but if you want to access from multiple computers you better use database because you can get problems with XML if two computers trying to write the file at the same time. I believe there are many other points which can influence your decision.
For a highscore I believe a XML file is smart enough and you can work with it very fast with Serialization/Deserialization.
Last edited by torrud; February 21st, 2007 at 11:23 AM.
Useful or not? Rate my posting. Thanks.
-
February 21st, 2007, 11:24 AM
#3
Re: XML or Database?
If you want to use huge amounts of data and need to retrieve it quickly, you probably won't want to use XML. It's a sequential storage medium ( that means that a search would would have to go through most of the document ). A rdbms like MS sql server , Oracle or Mysql would scale much better. There are also other factors like security of the data ( if you will use xml then you don't need security ) or like budget. If is just a simple application I don't see the use of a rdbms.
EDIT: Torrud was faster again
Bogdan
If someone helped you then please Rate his post and mark the thread as Resolved
Please improve your messages appearance by using tags [ code] Place your code here [ /code]
-
February 21st, 2007, 11:45 AM
#4
Re: XML or Database?
I would choose XML only if it were necessary to read or edit it from a text or XML editor. Otherwise, I don't see any reason why you couldn't just use a disconnected DataSet and serialize to binary file.
-
February 21st, 2007, 02:02 PM
#5
Re: XML or Database?
Question: Is this a system-wide high score or a network-wide high score, or just a per-user high score?
If it's just per-user, you could save the data in the application Settings object (you might want to encode it in some way that will prevent tampering, if that matters).
Also, it isn't always neccessary to use XML. If the data is simple enough, you can just use a plain old text file. I think some people go a bit overboard with XML.
-
February 21st, 2007, 02:09 PM
#6
Re: XML or Database?
Thanks much for help everyone. Ill use the XML :P
-
February 21st, 2007, 09:19 PM
#7
Re: XML or Database?
Care to explain why? There were more responses for alternatives than for using XML.
-
February 22nd, 2007, 10:13 AM
#8
Re: XML or Database?
 Originally Posted by spoulson
Care to explain why? There were more responses for alternatives than for using XML.
I need to create 5 different HighScore tables. I see the the database as unnecessary and the Save SettingsObject (Or however it called) of the application is kinda too simple. I see the XML as the best way to do that :S
-
February 22nd, 2007, 08:59 PM
#9
Re: XML or Database?
That's understandable. My response was for something else, though. However, XML serialized objects should work fine for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|