PDA

View Full Version : What should be faster: csv, json or xml?



Momergil
7th March 2014, 02:41
Hello!

In on of my applications, I have a customized database system (that is, I have a class that manages a database that should use files stored closed to the executable instead of a SQL or similar database system). The data to be stored is relatively simple: sets of data related to a given item.

The question I have is which is the best way of storing this data... For now, I'm writing it to common text files using CSV style (each line is an item, each data of that item is separated by a semicolon), but I know that Qt has support for JSON and XML archives. My doubt is if it wouldn't be better to use either of this two other alternatives instead of the methodology I'm currently using (and maybe even another option I'm not aware of).

So my question is: which is the best system to use? (or even "how can I know which is the best system" - without having to go to complicated comparative tests). And does the use of Qt interfere somehow in this decision? (For example lets say Qt's JSON infraestructure is not only faster than XMLs, but also less complicated to learn and apply)


Thanks,

Momergil

ChrisW67
7th March 2014, 04:14
which is the best system to use?
One that works. If you already have a solution that works, and you do not have a definite problem you need to solve (like poor performance or data corruption), then don't change it.

JSON works well if you have to send the data to a Javascript engine. XML would allow you to use XQuery to find entries in the data file.

anda_skoa
7th March 2014, 08:05
Just to make our life more miserable (har har!), SQLite is a database interface working on local files.

Cheers,
_

Momergil
9th March 2014, 20:14
Just to make our life more miserable (har har!), SQLite is a database interface working on local files.

Cheers,
_

Thanks anda_skoa for that information! I did a research and I found out that SQLite was what I was needing! :D

Changing a lot of code now... :S