Ask HN: SQL or NoSQL?
I need to analyze some football match data using a neural net. The data is in XML, one XML file per match. The XML file is really dirty. I wanted to know if its make sense to extract the data from XML and structure it first in an SQL DB? Or is it advisable to work directly with the XML files? If anyone has experience on the matter, I would really like to hear about it.
9 comments
[ 5.1 ms ] story [ 39.4 ms ] threadBut on the other hand... It sounds like this is training data for a neural net? In that case maybe working with the XML directly makes more sense?
In the end, I would probably go with SQL to start with just because the analysis features of relational databases would provide some really nice ways to check results. That may be secondary but it is significant.
If you need set-oriented operations, it's hard to imagine you can do better than use SQL, although that presumes that you have normalized the XML into SQL, which may or may not be trivial. Depends on the structure of your XML docs.
After the cleanup: hard to say what's best, but it depends on the structure of the data, what you want to do with it, and how much of it there is. To me, SQL is the tool of choice nearly always, unless you have requirements for data volume or data structuring that are incompatible. On the latter point (data structuring), since you have XML, I would guess that it would not be difficult to define a SQL schema. I.e., the schemaless aspect of NoSQL systems might not be important for you.
XML in the raw is not directly suitable for modeling or analysis. NoSQL solutions that query or otherwise make XML accessible are probably not worth the added trouble of their administration overhead.
XML extraction is simple to yield tabular data sets to feed into a model, database, data frame or otherwise.
You might need to write an importer that parses your xml, cleans it up.
I just setup an importer for weekly game results. I cut the data off the website that hosts our league and paste it into a form, select the season and week and then click import. It cleans up the text, sets the teams, gets the points, etc and inserts it in to MySQL.
I basically then display the data, run some calculations, etc.
This app is for a history of our league so we have our results if we change providers, etc.
As far as the best fit for you.
What is your goal, do you want to access this data run reports show historical data. If so I would extract it out to MySQL.
Or if you're just analyzing the match maybe import the xml file, show results as a one time process.
Good luck.