How do you Organize SQL Databases?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Publisher Bucks
    Confirmed User
    • Oct 2018
    • 1330

    #1

    Tech 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?
    Extreme Link List - v1.0
  • baodb
    Confirmed User
    • Jan 2021
    • 103

    #2
    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.

    Comment

    • k0nr4d
      Confirmed User
      • Aug 2006
      • 9231

      #3
      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.
      Mechanical Bunny Media
      Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

      Comment

      • fuzebox
        making it rain
        • Oct 2003
        • 22351

        #4
        You use one single database across multiple unrelated websites?

        Comment

        • Klen
          • Aug 2006
          • 32235

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

          Comment

          • hornyasf
            Confirmed User
            • Jul 2021
            • 185

            #6
            Originally posted by Klen
            Dont think i ever used single database for multi domains/sites. Different site, different database, end of story.
            Absolutely 100%

            Comment

            • Publisher Bucks
              Confirmed User
              • Oct 2018
              • 1330

              #7
              Originally posted by k0nr4d
              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
              Extreme Link List - v1.0

              Comment

              Working...