Converting XML to JSON and uploading to DB - mysql

I have a frontend app working with AngularJS. For the backend part, I plan to use the data dumps from an external API. These files span from 20MB to 3GB, and they are provided in xml.gz format.
My question is regarding the middle point between having these files and uploading them to a database. The idea is to have a database and to access it using REST from the frontend.
I'm considering node.js with a mysql module for the backend, but I don't really know what to to with the data files.
So, if I want the database to answer with json responses, do I have to convert the files to json before uploading them to the db? Or it doesn't matter?
Total n00by question, I know, but I'm kinda lost in the whole backend world.
Thanks!

Related

How to send data from Spark to my Angular8 project

Technologies I am using to fetch data from my MySQL database is Spark 2.4.4 and Scala. I want to display that data in my Angular8 project. Any help on how to do it? I could not find any documentation regarding this.
I am not sure if this is a scala/spark related question. It sounds more towards system design of your project.
One solution is to use your Angular8 directly read from MySQL. There are tons of tutorials online.
Another solution is to use your spark/scala to read data and dump to CSV/JSON file at somewhere and use Angular8 to read in that file. The pros is that you can do some transformation before displaying your data. The cons is that there is latency between transformation and displaying. After reading the flat file into JSON it's up to you how to render that data on user's screen.

How to migrate MySql Database to Firestore

I'm searching the best way to migrate my MySql database to Firebase's new Cloud Firestore.
What are the steps? I'm trying first of all to convert my tables and relations in my relational db to a document logic.
I read about Cloud Firestore REST API because I have more experience on using REST instead of socket, but I'm not sure if that's the point.
Is it a good idea to create a script starting from this sample and running it on nodeJS?
Has anyone already did this thing?
Thanks
I couldn't find a way to do that. But the way I suggest is using a programming language (python is preferable), make a script to turn all your data in the MySql database to a json format file structuring data in the way you want to store in Firestone. Then read the firestore API to populate instances in the documentary. This must work for sure!
You can convert your mySQL database to a CSV file, and then convert that CSV to JSON.

what is the advantage of an HTTP server serving database data dynamically in an HTML table vs one that serves the same data in JSON format?

i am just starting with this topic to study about it and hopefully be able to also programm deifferent stuff on the web . but for now i was wondering if a server serving data dinamically in an html table has any advantage over the same thing but in json format or the other way around. Thanks in advance!

Grails with CSV (No DB)

I have been building a grails application for quite a while with dummy data using MySQL server, this was eventually supposed to be connected to Greenplum DB (postgresql cluster).
But this is not feasible anymore due to firewall issues.
We were contemplating connecting grails to a CSV file on a shared drive( which is constantly updated by greenplum DB, data is appended hourly only)
These CSV files are fairly large(3mb, 30mb and 60mb) The last file has 550,000+ rows.
Quick questions:
Is this even feasible? Can CSV be treated as a database and can grails directly access this CSV file and run queries on it, similar to that of a DB?
Assuming this is feasible, how much rework will be required in the grails codes in Datasource, controller and index ( Currently, we are connected to Mysql and we filter data in controller and index using sql queries and ajax calls using remotefunction)
Will the constant reading( csv -> grails ) and writing (greenplum -> csv) render the csv file corrupt or bring up any more problems?
I know this is not a very robust method, but I really need to understand the feasibility of this idea. Can grails function wihtout any DB and merely a CSV file on a shared drive accesssible to multiple users?
The short answer is, No. This won't be a good solution.
No.
It would be nearly impossible, if at all possible to rework this.
Concurrent access to a file like that in any environment is a recipe for disaster.
Grails is not suitable for a solution like this.
update:
Have you considered using the built in H2 database which can be packaged with the Grails application itself? This way you can distribute the database engine along with your Grails application within the WAR. You could even have it populate it's database from the CSV you mention the first time it runs, or periodically. Depending on your requirements.

Appfog / Node.js - What's the best way to store data online?

I have an app online in Node.js on appfog that takes in user data. I need to store that data as a text file and me able to download it later. What's the best way to store these files?
I've tried setting up a MySQL or mongodb database, but I am having a lot of trouble. Is this the correct approach?
Thanks.