Author Topic: DB Structure  (Read 854 times)

Offline Slashmore

  • Level 17
  • *
  • Posts: 156
  • Reputation: +1/-0
    • View Profile
DB Structure
« on: October 09, 2009, 03:21:29 PM »
I've been looking around and I have found a lot of good infomation that will be used. One question I couldn't really find the answer for is "Is is good to have more or less tables"

I mean like haveing players and players_info

- Players . Holds user, pass, email ect

- Players_info . Hold how much time they have to wait before thier next crime action can be allowed ect.


Offline raestlyn

  • Level 29
  • **
  • Posts: 463
  • Reputation: +9/-5
    • View Profile
Re: DB Structure
« Reply #1 on: October 09, 2009, 04:04:41 PM »
if the players table holds on data that isn't checked all the time and only in ie. login, its good to have more tables like players_info.


I can send you pics of my cocks if you want reference.


Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: DB Structure
« Reply #2 on: October 09, 2009, 10:32:08 PM »
You should have exactly as many tables as your data needs. And no more or fewer.

(Caveat for those doing more than a half-million dynamic pages per day: do what you gotta do.)

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Sunchaser

  • Game Owner
  • Level 23
  • *
  • Posts: 296
  • Reputation: +3/-0
  • Game Owner
    • View Profile
    • Medieval Europe
Re: DB Structure
« Reply #3 on: October 10, 2009, 11:52:00 AM »

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: DB Structure
« Reply #4 on: October 12, 2009, 10:26:47 AM »
I'm a fan of database normalization which usually means more tables but LESS overall data. Also, it's the "proper" way to build a relational database structure which helps you preserve your data's integrity through foreign keys and the like.

That being said... sometimes you MUST sacrifice for the sake of performance. You can have the most beautifully built architecture the world has ever seen. But if it chokes and dies when a single user accesses a page it's not terribly useful. ;)
Idiocy - Never underestimate the power of stupid people in large groups.


Offline dbest

  • Game Owner
  • Level 20
  • *
  • Posts: 211
  • Reputation: +3/-0
    • View Profile
    • Tennis Masters
Re: DB Structure
« Reply #5 on: October 12, 2009, 10:55:31 AM »
When in college, I studied Database normalization and never did understand what the big fuss was about. Why do we have so many tables and why reduce a big chunk of data into smaller tables? Those were my questions:

Currently, I am trying my best to normalize my databases and I realize that most of my queries would require tables to be joined to provide with some useful info.

Might not really help you here. But I needed to get that off my chest. ;)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: DB Structure
« Reply #6 on: October 12, 2009, 12:16:23 PM »
Make 2 tables. From my experience it has the best ratio of simplicity to performance gain.

The choice you will face is what to do with username, you can do it 3 ways:
- store it in the low usage table (the one that stores password and email)
- store it in the high usage table (the one that stores game related info)
- screw normalisation and store it in both (my favourite :D)

And don't ever name a table like "Players_info", you will suffer each time you type it, make is shorter.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal