GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech How do you Organize SQL Databases? (https://gfy.com/showthread.php?t=1348552)

Publisher Bucks 09-22-2021 07:52 PM

How do you Organize SQL Databases?
 
So after the past couple of weeks, its becoming clear that I need a better way of managing and organizing my SQL databases, at present, I have each database listed by site name, with a table underneath it like this:

domain
- tablename

But was wondering if there might be a better method, perhaps creating one 'primary' SQL database and then adding a slew of single tables below it:

maindatabase
- recipes
- cars
- pets
- forum
- store
- casino
- etc

Are there any drawbacks or bonuses to using either method over the other or, perhaps, any other methods you might have or currently use to handle database management that may be better still? :question

baodb 09-23-2021 12:49 AM

I'd say it really depends on how you consume the data and the structure of your application. While there are surely best or common practices that are good to follow as a default, no one can give you a good answer to your specific use case without knowing what the scope of your application is.

k0nr4d 09-23-2021 02:04 AM

You should be using a separate db per site for several reasons:
- Table name overlap (you might need a users table on each site)
- Security (sql injection on one site will limit damage to the one site and not all your sites).
- Portability (you can move a single site to another server if you need)
- Corruption (single database getting corrupted can cause complete loss for all your sites)

I can't really think of a reason to use a single db like what you are describing.

fuzebox 09-23-2021 07:52 AM

You use one single database across multiple unrelated websites? :helpme

Klen 09-23-2021 07:52 AM

Dont think i ever used single database for multi domains/sites. Different site, different database, end of story.

hornyasf 09-23-2021 08:51 AM

Quote:

Originally Posted by Klen (Post 22916632)
Dont think i ever used single database for multi domains/sites. Different site, different database, end of story.

Absolutely 100%

Publisher Bucks 09-23-2021 09:11 AM

Quote:

Originally Posted by k0nr4d (Post 22916576)
You should be using a separate db per site for several reasons:
- Table name overlap (you might need a users table on each site)
- Security (sql injection on one site will limit damage to the one site and not all your sites).
- Portability (you can move a single site to another server if you need)
- Corruption (single database getting corrupted can cause complete loss for all your sites)

I can't really think of a reason to use a single db like what you are describing.

Okay cool, thanks, I guess I shall keep things how they are then :thumbsup


All times are GMT -7. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123