views:

66

answers:

1

After doing my exercise in school, I use Sqlite to store my data. But there's XML / JSON [ I haven't tried yet, but I prefer JSON because its' simplicity ], they're used to store data too. And they seems popular, there's JSON for C#,C++,py ....

I wonder when to use these ones ? And I'm happy to hear about theirs performance too, I care most about speed ;) Thanks.

+7  A: 

XML and JSON are actually used primarily to transmit data between processes or systems.

I have seen applications that use XML as a database. If you're going to do this, you'll have to break your data down into very distinct, small units that can each be stored in a separate file.

Overall, in my opinion and experience, if performance is your primary concern, file-based data storage in XML or JSON will almost never perform remotely close to an actual SQL relational database platform unless your dataset is extremely tiny.

Toby
+1. Pretty much what I was in the process of typing.
George Marian
+1. Also, in addition to transport, JSON and XML are commonly used as configuration files. Primarily, if the quantity of data is small and not being searched (i.e. all loaded in one slurp), file-based storage is fine. If you have more data and you're accessing it based on some attribute(s), in a specific order or just a part of it, or if there is more than a trivial bit of data and you mean to update them, in huge majority of cases you don't want the flat file format.
Amadan
@Amadan: Thanks for great explanation, I've seen a lot of app in Windows use specific file format to store config in ini. But it's not json, is it a better one or they're used to use it ?
nXqd
@nXqd: .ini-like formats (there's no solid standard) are common for configuration (sometimes even outside of Windows) and reasonably well-suited to the task, but configuration files are usually small and shouldn't be storing _data_ (configuration is what your program _does_, data is what it does it _on_).
Nicholas Knight
@Nicolas: Thanks :)
nXqd