Database Design – SQL or NoSQL – CSV data


My scenario:

There’s a flask WebApp where a user can login and upload a CSV file.

I need to store and be able to recall the data from the CSV.

Each user can have a different number of columns and rows in their CSV.

I was thinking I could create a unique table per user, recreate it each time a user uploads a new dataset.

However, maybe it makes more sense to just dump it into a NoSQL based database??

Looking for advice of what’s the best approach my scenario?


Since you are only storing and recalling CSV data, I presume you do not change anything within the CSV file. At this point you do not really need a database, in my opinion the simplest solution is to store the CSV file in a folder (let’s say each user has its own folder on the server).
Even if you have multiple CSV files for each user, you can store them in the same folder (with different names – you can come up with your own naming convention).
When you recall the file, you can scan the folder of that user and give him the list of files (if there are more than 1), so he can pick whatever CSV he/she wants to get back from the server.

Let’s talk about databases: a SQL-like database needs fixed structure (with some exceptions). So you would need to have a consistent dataset in order to add it to a sql DB. In your case it would be easier to use a noSQL database, since with noSQL you don’t care about the structure, is just "random" data that you store.

But again … if you don’t do anything with the data, only storing, just store the data as it is: CSV files.
If you have more info, we can brainstorm further.


Answered By – Mike

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published