I am in the process of setting up some reporting functionality for my company, Im gathering data from the likes of Google, Moz and our Courier. As part of the reporting I also want to get data from Magento. As this will be hosted in a very secure folder on our server. What I would like to know is what is the safest way for me to run queries on the Magento Data?
I could run
Direct SQL queries outside of Magento
SQL queries inside Magento but then would have issues getting them out of Magento automatically
Magento API
Which am I best doing from a safety and performance point of view for my website?