SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Number of databases for 1 web site

    Hi,

    Should one web site have about 2 databases? One for content and one for transaction information/customer details?

    Or is it sensible to have 2 or 3 databases for web site content? If I use 1 database for all content then some fields will be empty in each entry. If I use 2 databases for content it might be possible to have 0 empty fields.

    What issues determine the best choice for number of databases??

    Matt.

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Totally dependent upon your site. As you said I would seperate the ordering system into its own db. Website cms into its own and possible include the user system in with it.

    How does having multiple or one db affect your table design / empty fields? It shouldn't.

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you say include the user system as well do you mean the user-login/editing aspect of the site??

    Would you have the fields:
    Username
    Password
    etc.

    include these fields in the same database as the CMS? this would mean many empty fields (there will be at least 2,000 products listed so in the user-login part of the database there would be at least 1,995 empty fields).

    Are you sure empty fields are not a problem?!!?

    Matt.

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think you mean tables. Yes, you can use multiple tables for your site.

    Using multiple databases is a different question . . .

  5. #5
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Not too mention I think your confusing columns with rows... I'd do some googling before taking on a project that involves customer orders and private user information storage.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It really depends on which database system you are using. If you are using a full function database where particular users can be granted access to views that only allow them to see what they are supposed to have access to and where they can't access any of the other information at all then you will only need one database.

    The only reasons for using a second logical database is if the database you are using does not provide full functionality for security (or does so by your creating multiple logical databases within the physical database) or where you might need to move part of the site functionality to a different server (and therefore need to move the associated database as well.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •