Posts: 1
Registered: ‎09-14-2021

MySQL best practices with Python

Hi all,

I have been playing around with MySQL with Python for a while now, but there have been some questions on my mind. Unfortunately, I am the lone programmer in my company, so it is hard to learn 'best practices' (sometimes you don't have a specific question, but you are just wondering if you could do things 'better').

I have two questions: one specific and one more general:

So I have been scraping the Apple iTunes RSS feed for my company. I have been pulling hourly data for the top 100 grossing iPad and iPhone games for 40 countries (so total of 80 top 100 lists per hour). I have been storing these in 40 different tables (for every country) with a column that has the date and then two longtext columns that has a string with a list that contains 100 dictionaries with publisher and game name. So:

[{'Game': game_name1, 'Publisher': publisher_name2}, {'Game': game_name2, 'Publisher': publisher_name2}...]

One column in this case would be for iPad top 100 and one for iPhone top 100.

Now, this works. However, there is no one who can tell me 'sure, that works, but personally I would do it like this for x & y reason'. Do you guys have any feedback on using this structure? Are there better structures when using Python to dump 'large' amounts of data in a SQL database?

This leads me to my second question: does anyone have a good resource for MySQL best practices? Are there even any best practices?

Thank you in advance!