TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-13-2008, 03:27 PM   #1 (permalink)
The Wanderer
 
lucid's Avatar
 
Join Date: Apr 2008
Posts: 6
Thanks: 0
lucid is on a distinguished road
Default Four identical databases

I had an idea to start a web based game, but have four instances running at once (ie w1.site.com - w4.site.com). You could have an account on each, and each would be separate (except for the forums). So w1 would have an identically laid out users table to w2 (each would have username, password, email etc), but different records.

I don't know the best and most efficient way to go about it though :D

Either having four separate databases, or having one, but with a column in each table representing the game (ie users.game_id). I'd also like to synchronise all items between them, but have separate mail, so I don't know the best way to make sure the items etc are the same, while keeping others different.

Does anybody have any experience doing something similar? I've only ever worked with one database at a time before. Thanks! :)
lucid is offline  
Reply With Quote
Old 10-19-2008, 02:29 AM   #2 (permalink)
The Wanderer
 
lucid's Avatar
 
Join Date: Apr 2008
Posts: 6
Thanks: 0
lucid is on a distinguished road
Default

Any ideas?
lucid is offline  
Reply With Quote
Old 08-17-2009, 08:03 PM   #3 (permalink)
The Wanderer
 
Join Date: Aug 2009
Posts: 11
Thanks: 1
jasonberresford is on a distinguished road
Default

Unless you’re concerned about your servers ability keep up with four separate games, I would personally just designed to allow for a game identifier.

That way you don't need to duplicate data unless it's called for.

For example you decide Item1 needs to be different for Game3 .. When you change the data for the item is creates a second entry with the new details with an ID for game3 ..


Same goes for user registration, you could simply make one registration but give an identifier for which games they have access to.

Or of course, I didn't understand your question in which case, disregard. But in my experience, centralized has more pluses than minuses.
jasonberresford is offline  
Reply With Quote
Old 08-17-2009, 10:37 PM   #4 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

I would go with 1 database with an extra column to identify the game. 4 Databases is crazy talk. Especially if they are all hosted on the same server.
CoryMathews is offline  
Reply With Quote
Old 08-18-2009, 06:45 AM   #5 (permalink)
The Acquainted
 
JaoudeStudios's Avatar
 
Join Date: Jul 2009
Location: Surrey
Posts: 105
Thanks: 1
JaoudeStudios is on a distinguished road
Default

Each idea has its own advantages. The biggest advantage of using different databases is if it gets really heavy/busy you could move each database to its own server, however the downside to having multiple databases is JOINs become slower and JOINs across different servers are not permitted in MySQL - unless using Federated tables but thats another story.
__________________
JaoudeStudios.com | JaoudeStudios.com Forum | JaoudeStudios.com Blog
OpenSource is the road ahead...!
JaoudeStudios is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:39 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design