| | #1 |
| Active Warrior Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
|
I`m a beginner , this is my first project using php and mysql. I`m creating something like a browser-based game. I have a table for users , with 10 rows (but i`m adding more and more rows daily) and I need to create a new table to store the results of every mission of a given player. The problem is that I want to create more than 100 missions so thats mean more than 100 rows for the missions table. My question is how would be the best to store the missions result , and how many users can have my website , is there a limit for mysql ?:confused:
|
| | |
| |
| | #2 |
| People Know Me War Room Member Join Date: 2006 Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
|
I wouldn't worry about a limit. MYSQL can handle it. If I am getting you right I would... Create a table for missions. Then each row would hold the missions specifics. Create a table for users. Then each row would hold the info for the user. Login/Password and specific data that you want to hold. (points, missions completed, name, ect.) Not sure all the info you need to save for each mission but I would just save it all on the specific user row. |
|
My free PSD logs can be downloaded at PSD Bum. Enjoy!
| |
| |
| | #3 |
| Active Warrior Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
| |
| | |
| |
| | #4 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
|
Yes. If you are worried about performance, then it's a good idea to keep track of the execution time of your application as well as the database performance and the query execution time. |
| |
| | #5 |
| People Know Me War Room Member Join Date: 2006 Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
|
Sure. People have tested with billions. The more you have in there the slower it will be. Keep that in mind when building it. You may want to make more tables so theres less rows in each. Mission 1 Mission 2 Mission 3 etc. The more rows you have the longer it takes to find the row when doing a search in that table. |
|
My free PSD logs can be downloaded at PSD Bum. Enjoy!
| |
| |
| | #6 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
|
Yes, and while you're at it, build a database cluster as well and don't forget to have it all memcached kidding... but here is a link to some stuff about database performance and optimizing MySQL queries using indexes.Optimizing MySQL: Queries and Indexes What's your online game about anyway? |
| |
| | #7 |
| Active Warrior Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
|
Thanks for all these replies ! Now I`m no more worried :d
|
| | |
| |
| | #8 | |
| Enthusiastic Warrior War Room Member |
Have a USER table. This includes user ID number column, which is an id field, not null, auto increment, and also includes a user name column. Whatever else you want to keep track of about users - other than their missions - goes here. Have a MISSION table. This includes a user ID number column to cross reference the user for each mission. Include a foreign key constraint to guarantee that each mission is associated with a valid user. Look for a how-to article on database normalization, because this is a perfect start to your system. | |
| |
| | #9 |
| Active Warrior Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
|
another question :d Now i`m using a free webhost for testing the website before releasing it and at my cp I saw that i have a mysql size limit of 9mb , what is that meaning and how many places is needed to store 1.000.000 users each with 100 missions ? |
| | |
| |
| | #10 | |
| People Know Me War Room Member Join Date: 2006 Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
|
| |
|
My free PSD logs can be downloaded at PSD Bum. Enjoy!
| ||
| |
| | #11 | |
| Enthusiastic Warrior War Room Member |
With a 9 megabyte limit and one million users, you'd get to have nine bytes per user. Considering that first and last name alone are likely to run to 20 or 30 bytes, there's no way your free host could be suitable for what you envision. If you let people choose a login ID and password, enter their email address, and have any kind of user profile information, you're likely up to hundreds of bytes per user even before they have their first mission. That would let you have something like 3,000 users per MB if none of them have any missions. Since you haven't said anything yet about what's involved with the missions, there's no way to speculate how large your missions table will grow or whether it will need additional tables to keep track of each mission's details. | |
| |
| | #12 | |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
|
How much space do you need? That depends on what kind of data you store in the user and mission table. You can google "how to calculate the size of mysql database" to find out more. But, in your case, I would recommend that you grab a copy of XAMPP so that you can test your web application on your own computer. | |
| |
| The Following User Says Thank You to Manfred Ekblad For This Useful Post: |
| | #13 |
| Enthusiastic Warrior War Room Member |
Manfred's got a great idea there. If the game really does have a million-user potential, then you should spend all of your time raising money, establishing a business structure, and hiring (or making joint venture, profit-sharing deals) with programmers who already know how to program a site that large. Trying to do something like this on your own makes no more sense than Donald Trump taking a year off to learn how to weld before he makes a new skyscraper deal, or Richard Branson learning how to be a 747 pilot before expanding his airline. |
| |
| | #14 |
| Active Warrior Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
|
I have a good idea: I will add 2 new rows to the users table: mission id and missionenddate I will create a table: missions , where I will add each mission like the users (in 5rows) . |
| | |
| |
| | #15 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
| |
| |
|
| Bookmarks |
| Tags |
| mysql, needed, php |
| |