SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Location
    Texas
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How many tables are too many for 1 database?

    In MySQL, how many tables in one database is too many? When would you need to create an entirely new database?

    I've just been setting up a bunch of tables in one database - but I'm getting worried that as we implement database functionality across our whole site (5,000 pages) and add more and more tables, it will be too much for one database to handle.

    Should I even be worried about this? Our hosting company just gave us one DB - I could probably call them and get them to create another one, but I don't have the ability to create a DB myself.

  2. #2
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How many tables are too many for 1 database?

    Originally posted by emorgan
    In MySQL, how many tables in one database is too many?
    No such thing as "too many" - you should use as many tables as it takes to efficiently represent/store your data. However, if you end up with 5000 tables, then you've gone wrong in designing your DB structure!!!

    (In terms of efficiency, there may well be limits to the number of tables that a given database engine can access within a single database, but these aren't limits you should ever come close to.)
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  3. #3
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    just as an example we currently have 1 mysql DB which holds about 215 tables... and it works just fine

    I doubt you will need another dB at all.

    Sarah
    Regular user

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Location
    Texas
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help

  5. #5
    \m/ R.I.P. Dimebag! \m/ JimBolla's Avatar
    Join Date
    Dec 2001
    Location
    erie, pa
    Posts
    1,130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any technical limitations would vary from DB engine to DB engine.

    but stylistically.... at some point in a DB design phase for a structurally large database (perhaps 50 or more tables), i would consider if it would be a logical and efficient solution to split the database into multiple databases. depending on the nature of the database and its supporting applications, there may be several ways to split it up.

    for example, with a large commerce application, one could split a database based on the data, such as all customer/order data gets put in its own DB.

    or you may reorganize based on how often the data gets modified. for example, a data structure that has 50 tables: 20 of which get preloaded at the time of install and only ever change as part of a scheduled batch update process (or not at all) may get put into their own database separate from the tables that get updated regularly by the application that utilizes it. this has the very practical implication of allowing you to utilize a more efficient backup procedure. (data that only gets modified during a weekly batch update only needs to get backed up weekly as opposed to daily)

  6. #6
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good points there, CrowDozer!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


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
  •