After I made this question I decided that it would be best to store data on my own server. The data is in a table with 100-500 rows and 12 columns. I am a newbie programmer currently developing my first web app with JavaScript and PHP and I am looking for the best solution to store and retrieve this data. I have no needs to make complicated queries, I just need to retrieve each row of data based on the content in one of the columns.
I am considering a database for this purpose, however as I have no experience with databases I don’t know if it is the best solution for my needs. When I get the content it is actually in CSV format so I don’t know if it is better to just save it that way on my own server or saving it to a database. Then on client request I would tranform the data using PHP and send it as JSON.
- Is a database the best solution for my web app? or should I stick to CSV files?
- If a database is the best choice, could you please point me to a good tutorial, example or book to get started?
Thanks in advance.
Database is the best solution. If you are trying to pick out individual rows in the CSV file, there will be quite an overhead in parsing the whole file, just to get at a little piece of information. Databases on the otherhand are far more efficient at this, and will do it in a fraction of the time.
If you are using PHP, then the most common database to use is MySQL, and nearly every host will include this as standard.
Here is a nice tutorial to get you started, but google MySQL and PHP, and there is a huge amount of information on the web for you to get information. PHP and MySQL is very very popular, so there is a lot of info out there.