I am looking into building an online card game like that of Hearthstone. Players will have an unlimited inventory to store all the cards they own.
With this method there would be a very large their amount of data 1 row for every player card combination thus growing exponentially.
Originally, I wanted to have 3 tables:
A Player_Table
| Player_ID | Player_Name | Rank | Icon | ect...
A Card_Table
| Card_ID | Card_Name | Attack | Defence | ect...
And then an Inventory_Table for them
| Player_ID | Card_ID | Quantity |
Then I could use a statement like SELECT Card_ID FROM Inventory_Table WHERE Player_ID=YourID
Obviously, there is a scaling issue here where the more cards I add, and the more players join the longer this will take to get your card list.
I was thinking about using something like MongoDB as a NoSQL alternative to help with the potential performance issues that this would cause but then I found out its not free for commercial use unlike mySQL so I abandoned that plan.
The 3rd and final idea I came up with was dynamically adding tables. when a player is created (creates an account) I could just add a table with the name "Player_Cards_" + Player_ID (E.G. Player_Cards_318) Something is telling me this is a bad idea but I'm not sure.
Please could someone point me in the right direction please.